Use CSS to control the left and right arrangement of pages

Source: Internet
Author: User
Tags border color

In the content page of the website, I placed the 300*250 advertisement in the upper left corner, using the CSS floating <div style= "float:left;margin-right:15px;" ", because of the characteristics of CSS, this setting, when the height of the article more than 250 pixels, the article automatically moved to the bottom of the ads, instead of the left and right two columns, how to separate? So we give this div a vertical height <div style= "float:left;margin-right:15px;height:300px" > This height value set to how much, according to the needs of the page to adjust themselves.

In fact, this is similar to using CSS to draw a rectangle, you need to set the border color and width, look at the following example:

Draw rectangle: <div style= "width:300px;height:150px;border:1px solid #000 ″></div>

Draw vertical line (above example put middle): <div style= "width:300px;height:150px;border:1px solid #000 ″><div style=" Width:150px;height : 150px;border-right:1px Solid #000 ″></div></div>

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.