Help:Wiki University HTML-- Padding
- Nesting Lists
- Fonts - Changing
- Font Size
- Font Colors
- Font Bold-Italics
- Width and Height
- Tables - Borders
- Tables - Widths
- Tables - Captions
- Tables - Col Labels
- Tables - Cells
- Tables - Rows
- Tables - Placement
- Tables - Sorting
- Tables - Scrolling
- Tables - Col Only
- Tables - Col Spans
- Tables - Row Spans
- Infobox - Creating
- Infobox - Placing
- Infobox - If function
- Position - Relative
- Position - Absolute
PADDING[edit | edit source]
Consider the paragraph from the previous lesson and enclose it in a border.
You can see there is NO space between the text and the border. The text is right up against the border. A little space between the text and the border would probably help it look better.
PADDING ATTRIBUTE[edit | edit source]
We use the padding attribute to add a little space between the text and the border:
- The padding is on all four sides of the paragraph.
- Padding is called out in pixels.
- Any container that has padding added will expand to compensate.
Here is our paragraph with 10 pixel padding on all four sides:
- NOTICE the box expands to compensate for the padding. It does not sideways and the text shrinks to compensate because of the restriction in width but the box does expand both above and below the text.
LIMIT PADDING[edit | edit source]
We can limit padding to one or more sides. To pad only the left side use:
- NOTICE padding is only on the left side.
On two sides, you could use:
The padding attributes for each of the four sides are:
TRY THESE OUT . . . . .[edit | edit source]