CSS Layout instance: Upper Three rows, middle adaptive

Source: Internet
Author: User
Tags header relative
CSS Layout instance: Upper and lower three lines of layout, up and down high, the middle bar adaptive browser height, and content vertically centered. This code is passed in Firefox 2.0/win ie 6/win ie 7/opera 8.5 cn/win safari test. For non-IE kernel browsers, display:table, Display:table-row, and Display:table-cell are used to simulate the form's representation.

Outermost #box {display:table}, height 100%, its child layer #header/#main/#footer为 {display:table-row}, so you can simulate the row effect of the table, up and down high, then the middle of the high level of adaptive height.

#wrap层为 {Display:table-cell;} Simulates a cell, so you can set {Vertical-align:middle;}, centered vertically.

Because win IE does not support {display:table}, it can only be implemented in a positioning manner. Inside is the setting for IE.

The following is a reference fragment:




the next three lines of layout, up and down high, the middle bar adaptive browser height, and the content vertically centered www.cxybl.com





header




content


content


content


content


content


content


content


content


content



content


content


content


content


content





footer





Related Article

Alibaba Cloud 10 Year Anniversary

With You, We are Shaping a Digital World, 2009-2019

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

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.