CSS Basics points Subtotal 1-selector weight priority and one column adaptive in two-column layout, and another column fixed width

Source: Internet
Author: User

1: Style marked with!important

2:html Editing styles

3: User-set style

4: Browser Default Style

A column of adaptive, the other column fixed width, personally think the following method is more useful

<! DOCTYPE html>

CSS styles are as follows:

*{margin:0;padding:0;} #header, #footer {background-color: #E8E8E8;} #container {margin:10px 0;overflow:hidden;}. mainbox{    Margin-right:200px;background-color:lightblue;}. sidebox{    float:right;background-color:lightcoral;width:200px;}

Note the little tricks that float the fixed-width column, noting that it cannot have elements that block it from floating to the top, as the example code would put. Sidebox in front of. Mainbox. If the order of exchange can not float to the top of the block. Mainbox reserved 200px white space.

CSS Basics points Subtotal 1-selector weight priority and one column adaptive in two-column layout, and another column fixed width

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.