Style paddingLeft অপারেন্ট
- পূর্ববর্তী পৃষ্ঠা paddingBottom
- পরবর্তী পৃষ্ঠা paddingRight
- একত্রিভূমি ফিরে যান HTML DOM Style অবজেক্ট
定义和用法
paddingLeft
Definition and usage
paddingLeft Sets or returns the left inner padding of an element. padding-left property margin property
and
They all insert space around the element. However, the difference is that margin inserts space around the border, while padding inserts space inside the element's border.CSS ইন্টারন্যাপিং
See also:CSS Tutorial:
CSS Reference Manual:padding-left property
HTML DOM Reference Manual:
padding property
Instance
Example 1
Set the left inner padding of the <div> element:
Example 2
Reset the left inner padding of the <div> element to "normal":
Example 3
Returns the left inner padding of the <div> element:
alert(document.getElementById("myDiv").style.paddingLeft);
Example 4
Difference between marginLeft and paddingLeft:
function changeMargin() { document.getElementById("myDiv").style.marginLeft = "100px"; } function changePadding() { document.getElementById("myDiv2").style.paddingLeft = "100px"; }
Syntax
Return paddingLeft property:
object.style.paddingLeft
Set paddingLeft property:
object.style.paddingLeft = "%|length|initial|inherit"
Attribute value
Value | Description |
---|---|
% | Define left inner padding as a percentage of the parent element's width. |
length | Define left inner padding with length units. |
initial | Sets this property to its default value. See initial. |
inherit | Inherits this property from its parent element. See inherit. |
Technical details
Default value: | 0 |
---|---|
Return value: | A string that represents the left inner padding of an element. |
CSS version: | CSS1 |
browser support
Chrome | Edge | Firefox | স্যাফারি | ওপেরা |
---|---|---|---|---|
Chrome | Edge | Firefox | স্যাফারি | ওপেরা |
সমর্থন | সমর্থন | সমর্থন | সমর্থন | সমর্থন |
- পূর্ববর্তী পৃষ্ঠা paddingBottom
- পরবর্তী পৃষ্ঠা paddingRight
- একত্রিভূমি ফিরে যান HTML DOM Style অবজেক্ট