DIV CSS Web page tip: Border disconnection phenomenon in Web page layout

Source: Internet
Author: User
Tags modify
css| Skills | Web page

If there are two floats in the container, clear the float by clearing it. When you drag the scroll bar under IE, the outermost border disappears, and if you add width or height to the outermost layer, it will not appear. This is a strange phenomenon and it is not yet possible to explain what causes it. Look at the following example:

<div style= "margin:500px 100px 10px 100px;padding:50px;border:1px solid #ccc line-height:300%" > <div style= Some theories in the process of "float:left" > Web page Standardization <br some theories in the process of/> Web page standardization <br/> Some theories in the process of Web page standardization < Some theories <br/> </div> <div style= "float:right" > Web page Standardization during the standardization of BR/> Web page Some theories in the process of <BR/> Web page standardization process some theoretical <BR/> Web page standardization process of some theories <br/> Web page standardization process of some theories & lt;br/> </div> <div style= "Clear:both" ></div></div>

[Ctrl + A ALL SELECT hint: You can modify some of the code, and then run]

We can solve this problem through the following methods:
1. Add height:1% to Parent element
2. Add a width
3. Add a background color
Looking at the example below, we'll add a width to the parent element and we're done:

<div style= "width:660px; margin:500px 100px 10px 100px;padding:50px;border:1px solid #ccc line-height:300% "> <div style=" Float:left " ; Some theories in the process of Web page standardization <br some theories in the process of/> Web page standardization <br/> Some theories in the process of Web page Standardization <br/> Web page standardization process Some theories <br/> </div> <div style= "float:right" > Web page Standardization Process <BR Some theories in the process of Web page standardization <br some theories in the process of/> Web page standardization <br/> Some theories <br/> </div> <div style= "Clear:both" ></div></div>

[Ctrl + A ALL SELECT hint: You can modify some of the code, and then run]



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.