Two questions about CSS browser compatibility

Source: Internet
Author: User

Today, when I checked my website, I found that the layout was messy, so I decided to change it. However, my website is basically written based on Div + CSS. At that time, I only had IE6 on the machine, so it was normal when I only browsed IE6.

I installed a FF on my machine last year and made some modifications to ff. Now I have to make changes to IE7 again. I don't know when to make any changes to IE8. I believe IE8 will be available soon. Now it seems that I already have a test version in English. I have never seen this.

Basically, the problem I encountered was that IDV was highly adaptable to content and IDV was highly centered. I went to Baidu to find some information and tried several methods. I feel like I am using it! The best way is to combine important with Min-height. Other methods make me feel weird and uncomfortable. Try this method first.

GenerallyCodeYes:
Div # layout {
Height: Auto! Important;/* auto for non-IE 6 height */
Min-Height: 100px;/* For IE7 */
}
Of course, IE6 automatically adapts to this problem by default.

another problem is vertical center, which utilizes several features of IE6 IE7, such :! Important, *
the code is as follows
Div # HL {
vertical-align: middle;/* It is used to center IE7 but cannot contain padding, does not work for IE6 and FF */
* padding: 0px! Important;/* IE7 execution of IE6 will also execute FF not to execute */
/* the height of my entire div is 120, there is an image height of 60 in the middle, so the upper and lower padding is 30px */
padding: 30px 0;/* Run IE6 and FF */
}

Related Article

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.