Solve the Problem of invalid background of DIV in Firefox

Source: Internet
Author: User

There are two horizontal columns (DIV) in a large Div, and the background image is added to the large Div. However, after modification, the background image cannot be correctly displayed in Firefox.CodeYes:

1. html (sample ):

<Div id = "footer">
<Div id = "footer_left"> content1 </div>
<Div id = "footer_right"> content2 </div>
</Div>

2. CSS:
# Footer {
Width: 730px;
Background-image: URL (../images/bg.jpg );
Background-repeat: Repeat-y;
}
# Footer_left {
Float: left;
Width: 230px;
}
# Footer_right {
Float: left;
Width: 500px;
}

This is because your # footer_left and # footer_right add float: left. In ff, if float: left (right) is added to the element, it will not be supported, that is to say, its height is 0. If it is displayed normally, the following must be added: overflow: auto, I .e.: # footer {
Width: 730px;
Background-image: URL (../images/bg.jpg );
Background-repeat: Repeat-y;
Overflow: auto;
}

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.