CSS Instance tutorial: Non-floating area setting width

Source: Internet
Author: User

Some time ago I was doing the theme of green Gaint, I found a problem in the layout of floating. Let me explain, as shown in the following illustration:

We assume that there is a container a in which two containers B and c,b set the height and width, and float to the left, C does not float, it will surround the B area, which is typical of the floating effect, no problem.

However, when the C container is set to a width, and the width of B and C is less than the effect after a container, this is true in Firefox and IE8:

The performance in IE6 and IE7 is this:

Here, let's look at the B area as the main content area of the Web page, c area as a sidebar, to achieve B in the left, C in the right, B and C to retain a certain space, we also want to give C set the Margin-left property, when adding the property on the left margin, IE and Firefox are in the same layout.

Of course, you can not set the width of the C area, just add the left margin to achieve the desired layout effect, but sometimes we need to add width to the C region, you need to understand that Firefox, IE8 and IE6, IE7 for the layout of the performance is different.



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.