Div+css New beginning of Web layout design (7)

Source: Internet
Author: User
Below the back two horizontal div margin overlap problem


IE6 and Firefox are the same.
This indicates that the horizontal margin does not overlap

How the first div is not set to float, the 2nd one is set
Then it's not arranged horizontally.


Look at Firefox first.

Here you can see that for the div and normal div for float, the vertical margin is not coincident
Looking at the IE6.

2nd Div Unexpectedly put the left margin and the first Div added, is 10px, so that browser compatibility problem is very troublesome AH



A floating div can be positioned according to a common Div.


Can the normal div be positioned according to the floating div? Experiment.



This is where the 3rd div is deliberately bigger.

As can be seen, it is not known that the 2nd Div exists, but based on the first ordinary div to set the bit, the middle distance 50px
Here the 3rd Div does not cover the 2nd Div, but below him, and the 2nd div in a different color.

Because ordinary div can only be on the ground, impossible to the air

Look at the display of IE6 ...

I think using IE6 to learn CSS is a tragedy ...



So, can floating div be positioned according to floating div?


The answer is yes.

IE6 is the same.


Here's a summary
Floating elements can be positioned based on non-floating elements (that is, ordinary div) and floating elements.
Non-floating elements can only be positioned on non-floating elements and cannot be positioned according to floating elements

So, the metaphor for the airport has to be reinterpreted.
A floating element is a plane that flies in the air, a non-floating element, a plane parked on the ground.
How non-floating elements occupy an area, the floating element will not occupy the area, because the ground can be seen in the air, so can be based on non-floating elements to locate
And if the floating element occupies an area, the non-floating element on the ground is not aware of the situation in the air, so will not know its existence, so the two will occur coincident, one in the sky, a ground


The above is div+css page layout design New Beginning (7) content, more relevant content please pay attention to topic.alibabacloud.com (www.php.cn)!

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