Learn how to use Div + CSS to deploy a single line of three-column Div code!

Source: Internet
Author: User

CSSCodeAs follows:

Body {
Text-align: center;
Margin: 0px;
Padding: 0px;

}
# Father
{
Position: relative;
Width: 750px;
Text-align: center;
}
# Banner {Height: 96px; Background-color: #999; text-align: Left; padding: 0px; margin: 0px ;}
# B-left {width: 159px; margin: 0px; padding: 0px; float: Left ;}
# B-center {margin: 0px; float: Left ;}
# B-right {
Text-align: left;
Marign: 0px;
Padding: 0px;
Width: pixel PX;
Background-color: #00 FFFF;
Height: 96px;
Float: right;
}
The HTML code is as follows:

<Div id = banner>
<Div id = B-left> </div>
<Div id = B-center> </div>
<Div id = B-Right>
<Ul style = "list-style-type: none;">
<Br/>
<Li> set as homepage </LI>
<Li> Add to favorites </LI>
<Li> Contact Us </LI>
</Ul>
</Div>
</Div>

 

To sum up:

The layout of one row and three columns has the following ideas:

First, make an absolute layout and set the distance between each block and the surrounding area.

The second is to use the nested method to treat any two as one, and then set them together with the third! However, it seems that I have opened all three parts here, and it seems that there is no problem! Haha!

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.