Holy Grail Layout Original code

Source: Internet
Author: User

Set the left float to three div because the parent container sets the padding value, and the width of the middle main is equal to the width of the furong content.
Set the width of the left and right sides to 190px, the parent container padding a value of 200px, set 190px, to facilitate viewing the display effect:
The left side is set to margin-left:-100%, so that the left column is moved to the leftmost side of the element, the right side is set to margin-left:-190px;
Set position:relative;right:-200px;
is to let the right column fill the position of the padding-right value of the parent element, do not overwrite main above on the same line position; Set the left column posotion:relative;left:-200px; to make the left column fill
Padding-left value to the left of the parent element

<!     DOCTYPE html>{padding:0 200px;/*Set parent container left and right padding value to 200px*/Min-width:200px; }. Main{width:100%;Height:30px;Background-color:Skyblue;float: Left; }. Left{width:190px;/*set the left layout width to 190px*/Height:30px;Background-color:Blue;float: Left;Margin-left:-100%;position:relative; Left:-200px; }. Right{width:190px;/*set the left layout width to 190px*/Height:30px;Background-color:Pink;float: Left;Margin-left:-190px;position:relative; Right:-200px; }/*Holy Grail Layout*/</style>
Holy Grail Layout code

Holy Grail Layout Original code

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.