![]() |
< Day Day Up > |
![]() |
Laying the GroundworkThe first thing we ought to do is take a look at the markup with which we'll be working. Here are the first two sets of images and information in the document: <div class="pic ls"><a href="orig/img01.jpg" class="tn"><img src="tn/thumb01.jpg" alt=""></a><ul> <li class="title">The Ferrett's Daffodil</li> <li class="catno">03F01</li> <li class="price">$79.95</li> </ul></div> <div class="pic pt"><a href="orig/img02.jpg" class="tn"><img src="tn/thumb02.jpg" alt=""></a><ul> <li class="title">At Lunch</li> <li class="catno">03F02</li> <li class="price">$59.95</li> </ul></div> Whitespace Blues That's a lot of classes, and we ought to find out what they all mean. Fortunately, we have a style guide.
The really important classes are ls and pt, as we'll see soon enough, but all of them will come in handy. For example, we'll use those classes to set the height and width of the images. These aren't expressed in the HTML, as you can see. We know that our landscape thumbnails are 128 pixels wide by 96 pixels tall (with the portraits being 96x128), but we'll have to say so in the CSS before the project is done. To get started, let's add some basic body and footer styles. For the body element, we'll just add a light tan background and some margins. We know we'll be using float a lot, and we want the footer to show up after the images, so we'll clear it. These actions are illustrated in Figure 2.1. <style type="text/css"> body {background: #EED; margin: 1em;} div#footer {clear: both; padding-top: 3em; font: 85% Verdana, sans-serif;} </style> Figure 2.1. Taking the first steps.These styles won't change throughout the rest of the project, so we won't have to worry about them again. With that out of the way, let's get down to business! |
![]() |
< Day Day Up > |
![]() |