Div + CSS is a Web page layout technique

Source: Internet
Author: User

The following are some of the skills summarized in my work. I hope they will be useful to anyone who can see them ~~

 

1, UL: the default ul margin and padding values are not 0. If the left floating Li is used in the navigation, the external div is usually enlarged, causing page deformation: ul {margin: 0px; padding: 0px ;}

2,IMG: 1. Different browsers are involved here. The Image Height displayed in IE6 is always greater than the exact value. here we need to remember the IMG {display: block} below }; 2. It is best not to use a large background in the page, but to tile it. Otherwise, the loading will be slow, which is not conducive to future
Optimization and expansion, of course, some large websites, now try to put the background on a single picture and use background-postion to get the background. 3. The best format is the GIF format, which ensures that the background is transparent and there is no shadow in IE6. Sometimes the GIF image has a sawtooth image, which requires us to save it as a Web format, set matter. The closer the value of matter to the background color, the better.

3, Overflow: sometimes some companies use a long registration protocol, which uses overflow. You can add this in the style of Div: overflow: Auto

4, Float: sometimes some divs will be pushed to the top of the page, which may be caused by floating. You can add clear: Both.

5 . Div: div with height equal to 1px may not be 1px in IE6, add font-size: 1px in the style of this div; then OK.

6 , ID and class: when a style is used multiple times on the page, do not use ID, use class, and use JS, it is best not to use ID, because Id should be reserved for Js.

7 , link :. link: link {},. link: visited {},. link: hover {},. link: Active {}. One thing is that the order of visited and hover must not be reversed. Otherwise, IE6 will have a big problem.

8 : @ charset "UTF-8"; pay attention to the Code in this line. UTF-8 and G use gb2312 as two common encoding methods.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.