The first way to display the middle bar in a CSS three-column layout

Source: Internet
Author: User

Intermediary transaction http://www.aliyun.com/zixun/aggregation/6858.html ">seo diagnose Taobao guest cloud host technology Hall

The browser displays the page as one line of code execution, that is to say the first execution of the display, and for the left 3 column layout design, the code is either from the left-->--> right to write, or to come over from the right-->--> Zolai writing, to achieve the required effect , the first thing to write is the code in the column.

So I first defined a id=m div, and padding-left:150px, to define this is to leave the left column 140PX display position, and then nested in this div to define a id=middle div, I use position: differs attributes (absolute positioning), and then define left and right columns. One bad thing about using Position:absolute's properties is that it's like a layer in Photoshop, its automatic extension doesn't drive the entire layout, so it hides some page elements, like we usually write some information about the copyright at the bottom of the site, If you use this method of displaying the column first, the information will be obscured if you do not process it. The way to deal with this is to use JavaScript, so that the height of the left and right 2 columns is automatically extended along with the column.

  

<script language= "JavaScript" >

var L=document.getelementbyid ("left"). Scrollheightvar M=document.getelementbyid ("Middle"). Scrollheightvar r= document.getElementById ("right"), Scrollheightlayoutheight=math.max (l,m,r) document.getElementById ("left"). style.height=layoutheight+ "px" document.getElementById ("right"). style.height=layoutheight+ "px" document.getElementById ("Middle"). style.height=layoutheight+ "px" </script>

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.