HTML/CSS Service

CSS Padding Examples

Category: CSS, CSS 2 Tutorial    |    217 views    |    Add a Comment  |   

 

Padding is the distance between the border of an (X)HTML element and the content within it.

Most of the rules for margins also apply to padding, except there is no “auto” value, and negative values cannot be declared for padding.

  padding-top: length percentage
  padding-left: 
length percentage;
  padding-right: 
length percentage;
  padding-bottom: 
length percentage;

As you can also see in the above example you have 2 choices of values for the padding property

  • length
  • percentage

You can also declare all the padding of an element in a single property as follows: Read more…

Share/Save/Bookmark

 

CSS Padding Tutorials

Category: CSS, CSS 2 Tutorial, CSS Tutorials    |    451 views    |    Add a Comment  |   

In this tutorial you will learn about Cascading Style Sheets (CSS) Padding,

The padding is the space between the element border and the element content from the four sides, the padding attributes enables you to increase or decrease this space; unlike spacing padding space values can’t be negative.

To declare the padding you can use the following properties:
padding-top, padding-right, padding-bottom, and/or padding-left.
The values of these properties can be an absolute length, a percentage.

Example:

table
{
padding-top: 5px;
padding -right:3px;
padding -bottom: 5px;
padding -left: 2px;
}

Read more…

Share/Save/Bookmark