Div css optimization method

Source: Internet
Author: User
Tags comments

Optimization for ie

Sometimes, you need to define some extraordinary rules for IE browser bugs. Here there are too many css tutorial skills (hacks). I only use either of them, whether Microsoft is better able to support css in the upcoming ie7 beta version, these two methods are the safest.

1. Annotation method

(A) hide a css definition in ie. You can use the child selector ):

Html> body p {
/* Definition content */
}


(B) the following statement can only be understood by IE (hidden from other browsers ):

* Html p {
/* Declarations */
}


(C) sometimes you want ie/win to be valid while ie/mac is hidden. You can use the "backslash" technique:

/**/
* Html p {
Declarations
}
/**/


2. conditional comments

Another method, I think, is better than css hacks, is to use Microsoft's proprietary attribute condition comments ). With this method, you can define some styles for ie separately without affecting the definition of the main style table, just like this:

<! -- [If ie]>
<Link rel = "stylesheet" type = "text/css" href = "ie.css"/>
<! [Endif] -->

 

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.