Thursday, December 6, 2012

style.paddingLeft

Properti style.paddingLeft digunakan menetapkan padding kiri suatu elemen.

Sintaks:

obj.style.paddingLeft = value;

Nilainya:

Posisi PADDING-LEFT:

posisi margin, padding, dan border

Contoh:

<HTML> <HEAD> <TITLE>style.paddingLeft</TITLE> <STYLE TYPE="text/css"> #myp { border: 1px solid red; } </STYLE> </HEAD> <BODY> <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> <SCRIPT TYPE="text/javascript"> document.getElementById("myp").style.paddingLeft = "205px"; </SCRIPT> </BODY> </HTML>