Sams Teach Yourself HTML, CSS & JavaScript Web Publishing in One Hour a Day

(singke) #1
ptg16476052

Workshop 441

15


Quiz



  1. Which property tells the text to start flowing normally again, after a floated col-
    umn?

  2. How do you designate the containing block for an absolutely positioned element?

  3. What kind of rules would you write to change an ordered list of navigation links
    into a horizontal navigation bar?


Quiz Answers



  1. The clear property can be used after floated columns—for example, if you want a
    footer to reach across the entire browser window below the floated columns.

  2. You set the containing block by changing the position property, usually to a value
    of relative (with no offset properties designated).

  3. Listing 15.7 has an example of a style sheet with rules to do that, using the display
    property.


Exercises



  1. What kind of layouts can you create with CSS? Choose your favorite sites—either
    your own or some you enjoy using—and duplicate their layout styles with CSS.
    Existing sites make good models for doing your own practice, but keep in mind
    that unless you get permission, you shouldn’t just steal someone else’s code. Start
    with the visual appearance as you see it on the screen, and draw out boxes on paper
    as guidelines showing you where various columns are located. Use that as your
    model to write the HTML and CSS for building a similar layout.

  2. Try both of the techniques described in this lesson—using absolutely positioned
    content and using floating columns. Start with one version and convert it over to
    the other. Find a style of page that looks right to you and the CSS code that you
    think is easiest to understand, apply, and modify consistently.

Free download pdf