Styling the p Element


Styling the <p> Element

The <p> element must be padded on both sides to keep it away from the edges of its container. This can be achieved using padding: 0 20px as shown in Listing 17.5. The results can be seen in Figure 17.7.

Listing 17.5. CSS Code for Styling the <p> Element
div#pullquote {     margin: 2em;     background: #09f url(lesson17a.gif) no-repeat; } div#pullquote h2 {     margin: 0;     padding: 20px 20px 0 20px;     background: url(lesson17b.gif) no-repeat 100% 0; } div#pullquote p {     padding: 0 20px; } 

Figure 17.7. Screenshot of styled <p> element.





Sams Teach Yourself CSS in 10 Minutes
Sams Teach Yourself CSS in 10 Minutes
ISBN: 0672327457
EAN: 2147483647
Year: 2005
Pages: 234
Authors: Russ Weakley

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net