CSS Left fixed width right adaptive width summary __css

Source: Internet
Author: User
CSS Left fixed width right adaptive width summary

Two div side-by, left width fixed, right adaptive. My left side is the navigation bar, and the right side is divided into two parts.

Entire page:

html,body{
    margin:0px;
    height:100%;
}

1, the left navigation bar, the use of position:absolute;

. main-sidebar{
    Position:absolute;
    top:0;
    left:0;
    height:100%;
    min-height:100%;
    width:240px;
    Background-color: #222d32;
}

2, right

. right{
    margin-left:240px;
    height:100%; 
    Font:normal 20px/24px ' MicroSoft Yahei ';
}

The right side is divided into two parts, fixed above the height can:

. topbar{
    height:50px; 
    border:1px Solid #005580
}

You can also pass the properties of the Float:left.


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.