Small CSS experience: some tips for CSS hack compatibility

Source: Internet
Author: User

From the Internet:

 

1. Setting padding for Div under FF will increase the width and height, but IE will not. (available! Important solution)

2. center problem.
1). Vertical center. Set line-height to the same height of the current Div, and then use vertical-align: middle. (Note that do not wrap the content .)
2). horizontal center. Margin: 0 auto; (of course not omnipotent)

3. To add a style to the content of tag a, set display: block)

4. The difference between FF and IE in understanding box leads to the 2px difference. There are also issues such as Div set to float and margin doubling under IE.

5. UL labels are listed-style and padding by default under ff. It is recommended to declare them in advance to avoid unnecessary troubles. (commonly seen in navigation labels and content lists)

6. Do not set the height of the external wrapper Div. It is best to add overflow: hidden to achieve highly adaptive.

7. about hand-shaped cursor. cursor: pointer. And hand only applies to IE.

 

 

CSS hack in several browsers

  IE7 IE8 Chrome
* Y    
\ 9   Y  
       

 

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.