Exploring Footers
One of the nice things about old-school table layout methods is that they enable you to create liquid page designs very easily. If you want to center content vertically or stick cheap ed hardy
a footer to the bottom of the browser window, all you have to do is include one main table with a height of 100% and position elements inside of it. ed hardy
With web standards, you can’t do this anymore. The table height property is deprecated in XHTML, and web standards recommend that you avoid using tables for page layout. buy ed hardy
To divide structural markup from presentation, CSS is the way to go — but if you want to use CSS for vertical positioning, you face a lack of support from some mainstream browsers. This article explores the ways you can position footers using web standards, although the same techniques may be used to vertically position other elements. Many designs contain a footer that is positioned directly under the content area, unless the content and the footer together don’t fill the window entirely. In this case, the footer will be positioned at the bottom of the browser window. Absolute positioning in a relative box So how do you position a footer with CSS? Picture a container with a fixed width. The container consists of a variable amount of content followed by a footer with a fixed height. When you add content, the height of the container grows; when you subtract content, it shrinks. If you create a relatively positioned container and nest a content block, by default it will follow the normal flow inside the container, expanding or diminishing the height of its parent with its content. One of the strengths of relative positioning is that you can nest absolute-positioned elements inside of them. This makes it possible to nest a footer block and position it absolutely to “stick” at the bottom of the container. ed hardy woman wallets
However, absolutely positioned elements are taken out of the normal flow and are placed over normal flowed elements. Because you don’t want your footer to overlap your content,ed hardy woman shoes
you can add some padding to the bottom of the content block to compensate the footer’s height. You may view the result in example 1. This step doesn’t work correctly in Internet Explorer 5.x/Windows.ed hardy woman waches
For these browsers an absolutely positioned child loses its position when the height of the parent element is not set. We will focus on the container’s height in the next step. ed hardy woman socks
So far, the height of the container is determined by the height of the content block, which is cool if there is enough content to fill the height of the browser window (also called the viewport). If this is not the case you want the footer to stick to the bottom of the browser window.ed hardy woman sunglasses
The article is from http://www.alistapart.com/articles
- sailmold's blog
- 9 reads