Three-row Grail layout and double-wing layout

Source: Internet
Author: User

Related references:

Http://www.cnblogs.com/2050/archive/2012/08/13/2636467.html

http://www.imooc.com/wenda/detail/254035

Http://www.cnblogs.com/langzs/archive/2013/01/27/taobaoshuangfeiyi.html

First, the Holy Grail layout

<! DOCTYPE html>"ZH-CN"> "UTF-8"> <title> Test the problem of relative ambiguity </title> <meta http-equiv="x-ua-compatible"Content="Ie=edge"> <meta name="Viewport"Content="Width=device-width"> <link rel="stylesheet"href="Css/test.css"> class="Head">head</div> <divclass="Container Clear-fix"> <divclass="Main">main</div> <divclass=" Left">left</div> <divclass=" Right">right</div> </div> <divclass="Footer">footer</div> </body>

The corresponding style file:

. Head {width: -%; Background-Color:orange; Min-height:50px;}. container {padding-left:200px; Padding-right:150px; }.main {width: -%; Background-Color:pink; Min-height:300px; float: Left;    }.left {width:200px; Background-color:red; Min-height:300px; float: Left; Margin-left:- -%;    position:relative; Top:0; Left:-200px;}.    Right {width:150px; Background-color: #999; Min-height:300px; float: Left; Margin-left:-150px;    position:relative; Top:0; Right:-150px}.footer {width: -%; Background-Color:yellow; Min-height:30px;}. Clear-Fix:before,.clear-fix:after {content:""; display:table;}. Clear-fix:after {clear:both;}. Clear-Fix {zoom:1;}

Two, double wing layout

HTML code

<! DOCTYPE html>"ZH-CN"> "UTF-8"> <title> Test the problem of relative ambiguity </title> <meta http-equiv="x-ua-compatible"Content="Ie=edge"> <meta name="Viewport"Content="Width=device-width"> <link rel="stylesheet"href="Css/test.css"> class="Head">head</div> <divclass="Container Clear-fix"> <divclass="Main"> <divclass="Main-wrapper">main</div> </div> <divclass=" Left">left</div> <divclass=" Right">right</div> </div> <divclass="Footer">footer</div> </body>

CSS style code

. Head {width: -%; Background-Color:orange; Min-height:50px;} . Main {width: -%; Background-Color:pink; Min-height:300px; float: Left; }.main-Wrapper {margin-left:200px; Margin-right:150px;}.    Left {width:200px; Background-color:red; Min-height:300px; float: Left; Margin-left:- -%;    }.right {width:150px; Background-color: #999; Min-height:300px; float: Left; Margin-left:-150px; }.footer {width: -%; Background-Color:yellow; Min-height:30px;}. Clear-Fix:before,.clear-fix:after {content:""; display:table;}. Clear-fix:after {clear:both;}. Clear-Fix {zoom:1;}

Three-row Grail layout and double-wing layout

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.