9-9-12
1. Several Common webpage la s:
Fixed width layout: fixed width, which is very common, such as Sina Blog. For this layout, there is such a standard on the webpage width:
Specified fixed-width designs are about 760 pixels widea good size for 800x600 screens (since you need to leave a little room for scrollbars and other parts of the browsers "Chrome "). however, more and more sites (especially ones aimed at a more tech-savvy crowd) are about 950 pixels wide, on the assumption that visitors have at least 1024x768 monitors.
That is: for 800*600 display, 760 pixels are relatively good. For 1024*768 display, 950 pixels are suitable.
2. About the parameters of the margin attribute:
3. about absolute and relative:
When relative is used for location offset, the reference origin coordinates are their normal locations! Note: This location is affected by the elements such as margin and padding.
When using absolute for displacement, you must refer to its parent container until you find the parent container with the position attribute closest to it, and then use the origin of the parent container as the coordinate origin for displacement.
If not, the reference parent container is <HTML>.
In essence, position is used to move an element to a specified position! The key to moving is to find the coordinate origin of the reference. Essentially, relative and absolute are two methods to determine the reference origin. Regardless of whether the parent window of relative has been positioned or not, it just moves from its original location. While absolute is another method of positioning: it needs to find a parent container that has been positioned and shift it based on that parent container. This implies that the container using absolute must be used with the parent container that has been position. In this way, we can build a method to ignore the original positional relationship between each element and directly refer to the parent container for layout!