Laying the Groundwork


As usual, we'll need to dive into the markup of the project document the better to understand what we have to work with and get a peek at the document before we start adding CSS to it. Listing 8.1 gives us a detailed look at the markup for the weblog, and Figure 8.1 shows it in its raw, unstyled glory.

Listing 8.1. A Look at the Weblog's Markup
 <div > <h3><span>Eric's Thoughts</span></h3> <div > <h4 > <a name="t20031125" href="/eric/thoughts/200311.html#t20031123"   rel="bookmark">Hot Steaming Internet</a> </h4> <h5 > Tuesday, 23 November 2003 </h5> [...entry content...] <ul > <li ><a href="/eric/thoughts/wifi">WiFi</a></li> <li >No comments</li> <li ><a href="/eric/thoughts/pingbacks/t20031123">3   Pingbacks</a></li> </ul> </div> [...more entries...] </div> 
Figure 8.1. The unstyled weblog entries.

graphics/08fig01.jpg

There are a few things to note in particular:

  • The weblog's title ("Eric's Thoughts") is contained in an h3 element and a span element. This gives us two elements to work with when styling the title.

  • Each entry is enclosed in a div with a class of entry. This effectively groups all of the information related to a single entry into one piece of the document structure.

  • The title and date of a post, while given unique elements to contain the content (h4 and h5, respectively), have also been classed. This will allow us to style these aspects of an entry without worrying that an h4 or h5 might one day be used in the main text of an entry.

  • In a like manner, the extra information, contained in an unordered list, has been classed in a manner that will make each piece easy to style independently of the others and without letting the styles leak into the main text of an entry.

We'll take advantage of each of these points, and a great many other things, as we make these entries look better than ever.



More Eric Meyer on CSS
More Eric Meyer on CSS (Voices That Matter)
ISBN: 0735714258
EAN: 2147483647
Year: 2006
Pages: 109
Authors: Eric Meyer

Similar book on Amazon

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