The left and right side of the HTML is fixed width but the middle is the automatic layout way

Source: Internet
Author: User

For this layout, we can use absolute positioning to achieve this effect.

<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd
<meta http-equiv= "Content-type" Content= "text/html; Charset=utf-8 "/>
<title> Untitled document </TITLE>
<style type=" Text/css ";
body{margin:0px; padding:0px;}
. left{width:200px; height:500px; background: #666; position:absolute;left:0; top:0;}
. right{width:300px; height:500px; background: #009; position:absolute; right:0; top:0;}
. crent{height:500px; background: #069; margin:0 300px 0 200px;}
</style>

<body>
<div class= "left" ></DIV>
<div class = "Crent" ></DIV>
<div class= "right" ></DIV>
</body>
If you want to make a gap in the middle, just change the value of right and left to margin:0 310px 0 210px;

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.