Firefox outer frame Div background width color follows inside box Div adaptive

Source: Internet
Author: User

I have never understoodOverflow: hiddenWhat role does it play. Today, I suddenly found out that it is a good way to adjust browser compatibility. If the DIV nested outside is not given its height, it cannot automatically adapt to the DIV height in Firefox, it doesn't matter if you don't give the border color of the big Div, but if you give the border a width and color, what is displayed under Firefox is almost overlapped. All there is a way to add an attribute to the big Div, such as overflow: hidden. In this way, the self-adaptation of the following div is realized under Firefox. I have tested both IE, safail, Firefox and chrome. Below isCode, You can save the test. The big Div outside is warp.

<Style>
. Warp {margin: auto; width: 800px; Border: #000 solid 1px; overflow: hidden}
. Left_box {float: Left; width: 30%; Height: 600px; border-Right: # ff0 dashed 1px ;}
. Right_box {float: Right; width: 60%; Height: 600px; border-left: # f00 dashed 1px}
</Style>

. Mainxw {
Height: 100%;
Width: 830px;
Font-size: 12px;
Color: #000000;
Background-color: # ffffff;
Overflow: hidden;
}

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.