CSS webpage layout tutorial 5: Adaptive two-column width

Source: Internet
Author: User

Starting with the fixed width of the two columns, when trying the layout of the two columns, the width of the left and right columns can be adaptive. We know from the Adaptive Layout of the column, the adaptive setting is mainly based on the percentage value of the width. Therefore, in the Adaptive Layout of the two columns, the percentage width value is also designed. Continue with the above CSS Code To define the width of the two columns:

Copy code The Code is as follows: # Left {
Background-color: # e8f5fe;
Border: 1px solid # a9c9e2;
Float: left;
Height: 300px;
Width: 20%;
}
# Right {
Background-color: # f2fddb;
Border: 1px solid # a5cf3d;
Float: left;
Height: 300px;
Width: 70%;
}

The width of the left column is set to 20%, and the width of the right column is set to 70%. It looks like a common webpage with navigation on the left and content on the right.Xmlns = "http://www.w3.org/1999/xhtml">


Left column -- (aa25.cn) right column -- two-column width adaptive (aa25.cn)

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.