O'Reilly logo

Cascading Style Sheets (CSS) by Example by Steve Callihan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Setting the P Rule for Paragraphs

In HTML files, the P element is used to specify text to be formatted as text paragraphs (that is, as paragraph elements). As you'll notice in the example HTML file, each P element starts with a <p> start tag and ends with a </p> end tag, with text to be formatted as a text paragraph enclosed within the start and end tags.

You can add a style to your style sheet that specifies the formatting for all the paragraph elements within your page. In this section I show you examples you can try for setting left and right margins, top and bottom margins, first-line indents, and the line height for your page's paragraphs elements.

Setting Left and Right Paragraph Margins

Using styles, you have complete control over the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required