div background picture in Firefox does not show through Overflow:auto can be resolved

Source: Internet
Author: User

In a large div there are 2 row (div), and in the large div to add a background image. However, after the change, in Firefox but can not correctly display the background picture. The code is like this:
1.HTML (sample):

Copy Code code as follows:


<div id= "Footer" >


<div id= "Footer_left" >Content1</div>


<div id= "Footer_right" >Content2</div>


</div>


2. CSS:

Copy Code code as follows:


#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 code is left and right two columns of typesetting, using the parent div (footer) background picture as a child div (footer_left) background, to reach the left and the two columns height alignment.
Solution:
This is because your #footer_left and #footer_right add Float:left, and if the elements in FF add Float:left (right), it will not be stretched, that is to say, its height is 0, if the normal display, Must add: Overflow:auto,
That

Copy Code code as follows:


#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.