| Cascading StyleSheet Information, pg. 5 | ||
|---|---|---|
A partial list of selectors that versions of Internet Explorer before 7.0 ignore:
Positioning You can position layers and elements on the page however you want. Layers are, by default, positioned so that they're "stacked" on top of each other. The HTML code should resemble how your final layout looks in the browser so that it's easy to find what you want to change. Usually positioned elements are a part of the document flow, which means that elements around it know that it's there and act accordingly. Absolutely positioned elements, on the other hand, are ignored by everything around them. Floats Floats are either positioned left or right and other elements flow around them. Their default behavior is to be as high and as far to one side (left or right) as possible. If two floats are positioned side-by-side and the parent layer isn't large enough to hold them, the rightmost float will drop beneath the leftmost. It can be moved outside of the parent layer (any side) by using a negative margin on the side that will overlap. You can also overlap floats. It's not recommended to set a width on an element beside a float because Internet Explorer has a tendency to drop the non-float down below the float no matter how narrow the element is. Instead, use a margin to stop the two elements from overlapping. #navigation {width:175px; float:left;}
|
Relative Positioning Elements set to this property can be moved wherever you want them on the webpage and overlap will not occur because other elements automatically move out of the way. The container for this element is the one it would have occupied if it hadn't been moved out of place. The properties "top," "bottom," "left," and "right" are used with relative positioning.
#content #info {width:150px; padding:3px; position:relative;
top:50px; left:50px; border:1px solid #CCC;}
Absolute Positioning Elements set with this property can be moved wherever you want them on the webpage, but overlap may occur. The parent layer should be set to position:relative; with no offsets so that it will contain the absolute layer or else the <body> will be the container. The properties "top," "bottom," "left," and "right" are used with absolute positioning.
#container #header {position:relative;}
#header #search {width:125px; position:absolute;
top:2px; right:3px;}
Fixed and Static Positioning Fixed elements don't scroll with the webpage, they remain in a fixed position. They're ignored by the rest of the elements on the webpage. The properties "top," "bottom," "left," and "right" are used with fixed positioning. Static elements are positioned exactly how they are in the document, which is the default behavior of all elements. Miscellaneous Tags:
|
|