Holy Grail Layout Summary

Source: Internet
Author: User

Two days earlier wrote a blog about full screen layout and non-full screen layout, where the non-fullscreen speak a little bit of content, this time to talk about the full screen layout of some content, is the Holy Grail layout.

This site is the use of the so-called Holy Grail Layout, which is characterized by the site's left menu bar is fixed width, and the right side of the content area is not fixed width, can be stretched adaptively, by the current width of the browser to determine its width. In the layout method of the Web page, there are many kinds of column layout, and the Holy Grail layout is so many columns in the common is also commonly used, because it can do a column or even a multi-column fixed, a column width adaptive, as for the specific use of the layout of the way to see our needs.

So how does the specific Grail layout approach be implemented by code? We can take a look at this website.

I do not know if you understand, these three pieces of code is very good interpretation of the Holy Grail layout points.

First, our outermost box, Page-container, is 235px by setting a margin-left or padding-left, making the outermost box empty at the left 235px position in the layout.

Then, we page-container the child element, that is, our left menu bar Page-sidebar, at this time by a fixed width of 235px, while using position positioning or margin-left=-235px this way of writing, Let our left column return to the original vacated position.

Finally, our content area only needs to be set to a width of 100%, and our Grail layout is finished.

Holy Grail Layout Summary

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.