Chapter 8 Formatting Paragraphs by Using Style Sheets

To apply a first-line indent

Indenting Paragraphs

Within the tag:

<tag style="text-indent: npx">text</tag>

where tag is any tag and n is a number of pixels. For example:

<p style="text-indent: 20px">Now available!</p>

In a style sheet:

tag {text-indent: npx}

To apply padding (space inside an element)

Indenting Paragraphs

Within the tag:

<tag style="padding: npx">text</tag>

where tag is any tag and n is a number of pixels. For example:

<p style="padding: 5px">Now available!</p>

In a style sheet:

tag {padding: npx}

To apply a margin (space outside an element)

Indenting Paragraphs

Within the tag:

<tag style="margin: npx">text</tag>

where tag is any tag and n is a number of pixels. For example:

<p style="margin: 5px">Now ...

Get HTML and XHTML Step by Step now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.