Div, three rows, two columns

Source: Internet
Author: User

Today, div + CSS is more and more popular with search engines and web designers, but it is also because a CSS file is too large, if you accidentally lose it, it will be a terrible webpage. Because of its convenient modification, we are always infatuated with it. I always want to create a software that can control Div layout very well, so that we can not write CSS. How good is it? Although there is, it has never been found, let's take a look at the layout of the following Div three rows and two columns.

<Body>

<Div id = "Header"> header </div>

<Div id = "contain">

<Div id = "mainbg">

<Div id = "right">

<Div class = "text"> content </div>

</Div>

<Div id = "Left">

<Div class = "text"> left </div>

</Div>

</Div>

</Div>

<Div id = "footer"> footer </div>

</Body>

The above basically completed three rows and two rows, starting with the content (left and right), footer layout, below we can adjust the CSS below, it is OK, save the following CSS as a separate CSS file. You can also use styles to write them in the same webpage, which is troublesome. If you want to use other webpages, it is not good. It is better to use them as an external file.

Body {

Text-align: center; color: #333; font-family: verdana,
Arial, Helvetica, sans-serif;

}

# Header {

Margin-Right: auto; margin-left: auto; padding: 0px; width: 776px; Height: 50 PX; text-align: left;

}

# Contain {

Margin-left: auto; margin-Right: auto; width: 776px;

}

# Mainbg {

Float: Left; padding: 0px; width: 776px; Background: #60a179;

}

# Right {

Float: Right; margin: 2px 0px 2px 0px; padding: 0px; width: 574px;
Background: # ccd2de; text-align: left;

}

# Left {

Float: Left; margin: 2px 2px 0px 0px; padding: 0px; Background: # f2f3f7;
Width: 200px; text-align: left;

}

# Footer {

Clear: Both; margin-Right: auto; margin-left: auto; padding: 0px; width:
776px; Background: # Eee; Height: 60px;

}

. Text {

Margin: 0px; padding: 20px;

}

In this way, the layout of a basic three-row and two-column structure is formed.

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.