A strange phenomenon in the bug:ie6 of CSS!

Source: Internet
Author: User
Css

First of all, it is my colleague Xpoint met, not my starting. Do not say this sentence I am sure to be beaten ... The ID is not displayed properly under IE6 when used in combination with class.

CSS code:

#f {font-size:20px}
#f. a{color:red;}
#f. B{color:black font-size:50px}
#f. C{color:blue;}
#f. D{color:orange;}

HTML code:

<div id= "F" class= "a" >a</div>
<div id= "F" class= "B" >b</div>
<div id= "F" class= "C" >c</div>
<div id= "F" class= "D" >d</div>

Imagine what IE would interpret it as?

Look at the following effect:

<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 strict//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" >< HTML xmlns= "http://www.w3.org/1999/xhtml" ><pead><meta http-equiv= "Content-type" content= "text/html"; Charset=utf-8 "/><title>www.webjx.com</title><style type=" Text/css "> #f {font-size:20px} #f. a{ color:red;} #f. B{color:black font-size:50px} #f. C{color:blue} #f. D{color:orange;} </style></pead><body><div id= "F" class= "a" >a</div> <div id= "F" class= "B" >b</ div> <div id= "F" class= "C" >c</div> <div id= "F" class= "D" >d</div></body></ptml

[Ctrl + A ALL SELECT hint: You can modify some of the code, and then run]

In fact IE6 only identified #f.a{color:red, and the last three sentences were ignored. We have to show that we have no language and we do not understand it. (This phenomenon appears normal in Firefox, Opera, IE5)



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.