Styling the div Element


Styling the <div> Element

The first step in creating a round-cornered box is to style the <div>, which needs to be given some space on all sides. This can be achieved using margin: 2em. Next, the <div> needs to have a background image applied to the top-left corner. Use background: #09f url(lesson17a.gif) no-repeat; as shown in Listing 17.3. The results can be seen in Figure 17.5.

Listing 17.3. CSS Code for Styling the <div> Element
div#pullquote {     margin: 2em;     background: #09f url(lesson17a.gif) no-repeat; } 

Figure 17.5. Screenshot of styled <div> 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