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

(singke) #1
ptg16476052

312 LESSON 11: Using CSS to Position Elements on the Page


Quiz



  1. What is the normal flow?

  2. When you position an element relatively, how does that position affect other ele-
    ments on the page?

  3. How do the absolute and fixed positioning schemes differ?


Quiz Answers



  1. The normal flow is the default layout of the page, with elements flowing from left
    to right and top to bottom. Positioning is used to alter the placement of elements in
    the normal flow or to remove them from that flow entirely.

  2. The relative positioning system does not affect other nearby elements. They are
    placed within the normal flow as they would be if the element were statically posi-
    tioned.

  3. The absolute positioning scheme positions elements relative to the closest posi-
    tioned ancestor. The fixed positioning scheme positions elements relative to their
    viewport maintaining that position as the page scrolls.


Exercises



  1. Create a page with a navigation element on the right side that follows the user as
    she scrolls down the page.

  2. Alter the drop-down navigation menu example so that there is a second-level sub-
    menu. You should be able to follow the pattern of the submenus to create the sec-
    ond submenu.

Free download pdf