CSS hack for Firefox IE6 IE7 IE8

Source: Internet
Author: User

Detailed source reference: http://www.jb51.net/css/15987.html

During the tab switch today, we encountered a problem. IE8, IE7, and Firefox did not parse the PX height in a uniform way. We plan to start
! Important solved the problem and later found that IE7 and IE8 all support this. It cannot be judged at all. So I found an article on the Internet.

 

We used most of the CSS hack for Firefox IE6 IE7 IE8! Important comes to hack, which can be displayed normally for IE6 and Firefox tests, but IE7 and above! Important can be correctly explained, and the page will not be displayed as required! After searching, I found a good hack Method for IE7 and IE8. IE7 uses * + HTML or * line-Height: 23px.

 

CSS hack for Firefox IE6 IE7 IE8
We used most of them in the past! Important comes to hack, which can be displayed normally for IE6 and Firefox tests, but IE7 and above! Important can be correctly explained, and the page will not be displayed as required! After searching, I found a good hack Method for IE7 and IE8. IE7 uses * + HTML or * line-Height: 23px, and IE8 uses "\ 9" to differentiate, for example: line-Height: 26px \ 9.

 

CSS can be defined as follows. Pay attention to the sequence:
# Menu {Line-Height: 23px;}/* implement this definition in Firefox */
# Menu {Line-Height: 26px \ 9;}/* IE6, IE7, and IE8 define the hack for IE8 */
# Menu {* line-Height: 23px;}/* IE6, IE7, which defines the hack for IE7 */
# Menu {_ line-Height: 23px;}/* This definition is preferentially implemented by IE 6 browser */or written into a sentence

# Menu {Line-Height: 23px; line-Height: 26px \ 9; * line-Height: 23px; _ line-Height: 23px;} or

* Html # menu {Line-Height: 23px;}/* implement this definition in IE 6 */
* + Html # menu {Line-Height: 23px;}/* implement this definition in IE 7 */

Detailed source reference: http://www.jb51.net/css/15987.html

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.