How to handle the floating problem of div + css layout

Source: Internet
Author: User

Last time, I shared the layout skills of DIV + CSS webpage design and production pages. I believe we have some knowledge about the web page layout technique. In fact, when we conduct div + css web page layout, the css layout will fluctuate between the left and right. Here we will share with you how to handle the floating problem between the left and right sides of the div + css layout. First look at the following code snippet: css code:

# Left {float: left; width: 200px; }# right {float: right; width: 800px ;}

 

Page code: <body> <div id = "content"> <div id = "left"> left column </div> <div id = "right"> right column </div> </div> </body> This is the most commonly used code for Left and Right layout in css writing. There are other methods for css writing, such as fixed width on the left side and automatic adaptation on the right side. The right side of the fixed width on the left side automatically adapts to the css code: # left {float: left; width: 200px; }# right {margin-left: 200px ;}
# Left {float: left; width: 200px;} # right {margin-left: 200px ;}

 

The above css writing is the most standard css writing. If the css code written on the basis of the above changes between the left and right, check whether the code in the left and right sides is standardized. </div> whether the code at the end of this div is written more or less. We only need to pay attention to the above situation and basically solve the problem of div + css layout floating around. Reprinted Please note: http://www.jnsino.com

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.