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

Source: Internet
Author: User
First we define a div with a length of 500px, and you can think of it as a large box, in order to see it clearly, we'll show the solid line in its frame.


There will be a lot of div inside you can understand a big box with other small boxes
Let's put one first.


You will see

The picture is not complete, you can see this inside div tightly to the top left corner of the big Div

Plus

margin-top:5px;margin-left:5px

Yes


Margin is to set the margin, if set here

margin-right:5px;margin-bottom:5px

No effect.
Because there's nothing behind it and underneath.

Here's a look at the inner margin


Effect a try to see out, very simple

Found a problem in the IE6 and 360 browser in the div set the length and height of the premise, incredibly able to adapt, that is, content no matter how much less, will not burst div, but the original length and height changed
In fact, this is not in line with the norm. Firefox browser is normal.


You can try it out, it's a browser compatibility issue.


Running under Firefox browsing is

The right

In the IE6 browser is

of the wrong


The length and height of a div is the margin (two) + border (two) + padding (two) + content length

Anyway, remember, the long width of the div doesn't mean the long width of the content.

The above is div+css page layout design New Beginning (4) 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.