Thursday, December 6, 2012

style.marginBottom

Properti style.marginBottom digunakan menetapkan margin bawah suatu elemen.

Sintaks:

obj.style.marginBottom = value;

Nilainya:

Posisi MARGIN-BOTTOM:

posisi margin, padding, dan border

Contoh:

<HTML> <HEAD> <TITLE>style.marginBottom</TITLE> <STYLE TYPE="text/css"> #mydiv { margin: 0 auto; border: solid black 1px; } #myp { border: 1px solid red; } </STYLE> </HEAD> <BODY> <DIV ID="mydiv"> <P ID="myp">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque condimentum ultricies rutrum. Mauris vitae dolor a felis semper bibendum a vitae felis.</P> </DIV> <SCRIPT TYPE="text/javascript"> document.getElementById("myp").style.marginBottom = "400px"; </SCRIPT> </BODY> </HTML>