Padding on a given side
suggest changeThe padding property sets the padding space on all sides of an element. The padding area is the space between the content of the element and its border. Negative values are not allowed.
You can specify a side individually:
padding-toppadding-rightpadding-bottompadding-left
The following code would add a padding of 5px to the top of the div:
<style>
.myClass {
padding-top: 5px;
}
</style>
<div class="myClass"></div>
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents