Learning Standards-notes:
1. if an object has float, width is basically not used.
2. Sometimes there are requirements on the Writing sequence of p. Write float first.
3. Finally, I understand why IE is so annoying.
An example of three columns: Adaptive middle column
There is a problem here, that is, there will be a small gap between the three columns, which is not available in FF, so if you want to form a continuous effect, you can define the background in main.
<! DOCTYPE html PUBLIC "-// W3C // dtd xhtml 1.0 Strict // EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <meta http-equiv = "Content-Type" content = "text/html; charset = gb2312 "/> <style type =" text/css "> <! -- # Left {float: left; width: 200px; height: 200px; background: orange;} # middle {height: 200px; background: # eee;} # right {float: right; width: 200px; height: 200px; background: black ;} --> </style> <p id = "main"> <p id = "left"> </p> <p id = "right"> </p> <p id = "middle"> </p>
[Ctrl + A select all Note: If you need to introduce external Js, You need to refresh it to execute]
Center the page vertically
<Style> # test {width: 100px; height: 100px; position: absolute; left: 50%; top: 50%; margin:-50px 0 0-50px; background-color: #000} </style> <p id = "test"> </p>
[Ctrl + A select all Note: If you need to introduce external Js, You need to refresh it to execute]