Solution to the div+css of the outer background color of Firefox

Source: Internet
Author: User

The code is as follows:


<div class= "Header" >
<div class= "Header_left" >header_left</div>
<div class= "Header_right" >header_right</div>
</div>
. header{width:1000px;background:red;}
. header. Header_left{width:600px;background:green;float:left;}
. header. Header_right{width:400px;background:pink;float:right;}
. Clear{clear:both;}


Such div+css are normal in IE and chrome, but the background color of the header in Firefox is not shown.
After the. Header_right tag, add the <div class= "clear" ></DIV> the background color of the outer layer is displayed without problems,
But there is a blank line above the header, and the solution on the Internet is to add the CSS style of the outer div

The code is as follows:
Overflow:hidden;


The results do solve the problem, but the reason O (∩_∩) o~ is not available ...

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.