Graphics Programs Reference
In-Depth Information
156
Figure 4-51: A fi xed header.
If you just leave it at that, you will very likely run into a problem: h e top of the page's content
will sit underneath the header, and nobody will ever be able to read it. To make it visible, you
need to move the page's content downward.
One way to do this is to pad the top of the page by a measure at least as great as the height of
the header (see Figure 4-52).
body { padding-top : 100px ;}
h ere's another potential problem here, which is that page up and page down will skip
through the page at browser-window heights. h is takes no account of the i xed header. h us,
someone who uses page up/down will very likely miss several lines of content with each jump.
h ere isn't a simple command to tell the browser to “skip less.” Instead, you have to redei ne
the window in which the content appears (see Figure 4-53). h at would mean applying i xed
positioning to a div that surrounds the rest of the page. For that, you'd drop the body
padding and do something like this:
.contain { position : fixed ; top : 100px ; bottom : 0 ; width : 100% ;}
 
Search WWH ::




Custom Search