CSS layout--solid width, width, width and width

Source: Internet
Author: User

learned the front-end quite a long time, recently wrote a project test system, the layout of the discovery of their own to widen + The fixed width of the layout is not fully mastered, so summarize here, in the future when needed to look back.

1. The simplest of course is one or more columns of fixed width

For example, two columns of fixed width:

1. set a perimeter div--container, which is the total size of the two columns, which can be fixed 800px equivalent.

2. set two div--side,content , respectively within the container

set the pixels as needed, such as a 300px , the other is 500px ;

Set separately Float:left;

2. The two columns are widened to the same 1, except that the pixels are changed to a percentage, for example a 30%, and another 70%

3. The focus is on, two or more columns have a fixed width, there is a widening--typically a column left solid width, a column right widening

1. set a perimeter div--container, which is the total size of the two columns, which can be fixed 800px equivalent.

2. set two div--side,wrap_content , respectively in container

set the width as needed, such as a width:300px , the other is width:100%;

Margin-right: -300px;

3. set float:left respectively ;

4. set a divwithin wrap_content:content, margin-right:300px;

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.