苏州为什么不建机场| 饕餮长什么样| superstar什么意思| 1981年五行属什么| 处暑吃什么传统食物| 金牛座和什么星座最配| 近视什么意思| 什么的搏斗| 头部容易出汗是什么原因| 黍米是什么米| 走之底的字与什么有关| 就寝什么意思| 造诣是什么意思| 向心性肥胖是什么意思| 长生是什么意思| 替班是什么意思| 97属什么| 耳朵疼吃什么药| 怀孕喝什么牛奶好| 慌张的反义词是什么| 伊索寓言有什么故事| 婴儿什么时候长牙| 左卵巢内囊性结构什么意思| 水生什么五行| 缩量横盘意味着什么| 松鼠桂鱼是什么鱼| move什么意思| 下巴疼是什么原因| 路旁土命什么意思| 垂是什么意思| 苏字五行属什么| 什么是免疫组化检查| 嗤笑什么意思| 令坦是对方什么人的尊称| 党参有什么功效| 虫草能治什么病| 日本旅游买什么东西最划算| 公分的单位是什么| 孔雀蓝配什么颜色好看| 为什么男怕属鸡| 强迫症吃什么药| 查心脏挂什么科| 白色代表什么| 心脏供血不足是什么原因引起的| 三文鱼不能和什么一起吃| 肝喜欢什么食物| 口唇疱疹用什么药膏| 普拉提是什么意思| 着床出血什么时候出现| 手淫过度吃什么药| 活检检查是什么意思| 紫癜是什么引起的| pvr是什么意思| 子宫前置是什么意思| 有什么症状是肯定没怀孕| 阳历一月份是什么星座| 为什么智齿到晚上更疼| 胆囊炎吃什么药效果最好| 不晨勃是什么原因| 什么食物含钙量最高| 恶性贫血是什么意思| 愿闻其详是什么意思| 左胸隐痛什么原因| 什么叫柏拉图式的爱情| 肚子疼吃什么| 高中生吃什么提高记忆力| 六个坚持是什么| 眼睛总是流泪是什么原因| 今天什么地方地震了| maggie是什么意思| 豆角不能和什么一起吃| 咽喉炎是什么症状| 胰腺炎吃什么中成药| 2月5号是什么星座| 晚上尿多吃什么药| 小金鱼吃什么食物| 出什么什么什么| 喝红茶有什么好处和坏处| 看脑袋挂什么科| 药店为什么不让卖高锰酸钾| etf是什么意思| 为什么一到晚上就痒| 左舌根疼痛是什么情况| 费神是什么意思| xswl是什么意思| 10月24号什么星座| 宸字属于五行属什么| 丛林之王是什么动物| 乙肝表面抗体定量偏高什么意思| 谷字五行属什么| 自带bgm是什么意思| 龙是什么命| 胸部dr是什么| 拉肚子去医院挂什么科| 寻常疣是什么样子图片| 4月23日是什么星座| 阁老相当于现在什么官| 水瓶男喜欢什么样的女生| 什么人不能吃绿豆| ups是什么快递| 钙化斑是什么意思| 3n是什么意思| 肾萎缩吃什么药好| 水军什么意思| 胆识是什么意思| 潘字五行属什么| 男生喜欢女生有什么表现| 点读笔什么牌子好| 胃气胀是什么原因怎么解决| 发烧喝什么药| 什么叫肠易激综合征| 御史相当于现在什么官| 吃什么药通气放屁最快| 蔬菜用什么肥料最好| 打鼾是什么意思| 什么是985| 皇汉是什么意思| 医院建档是什么意思| 亚麻籽吃了有什么好处| 化纤是什么面料| 胃溃疡十二指肠溃疡吃什么药| 头部MRI检查是什么意思| 茄子炒什么好吃| 西瓜什么时候传入中国| 传教士是什么姿势| 星期一右眼皮跳是什么预兆| 怀孕吃什么好| 玉皇大帝的老婆叫什么| 30岁以上适合用什么牌子的护肤品| 玉米有什么营养| 玉皇大帝和王母娘娘是什么关系| 宫颈纳氏囊肿什么意思| 75年的兔是什么命| 心阳虚吃什么药| 梵蒂冈为什么没人敢打| 怀孕感冒了有什么好办法解决| 10月16是什么星座| 干红是什么意思| 扑热息痛又叫什么名| 有市无价是什么意思| 肝寒吃什么中成药| 雪芽是什么| 红色加黄色是什么颜色| 气滞血瘀吃什么药| 什么里什么云| 卟啉病是什么病| 天成是什么意思| 有生之年什么意思| 生性是什么意思| zara中文叫什么| 枸杞喝多了有什么坏处| 阳虚是什么意思| 右大腿上部疼痛是什么原因| 7月12是什么星座| 藿香正气水什么人不能喝| 2004属什么生肖| 血压表什么牌子的好最准确最耐用| onlycook是什么牌子| 口什么舌什么| 拔牙后吃什么恢复快| 维生素b族适合什么人吃| 健身rm是什么意思| 无痛人流和普通人流有什么区别| 梦见很多鱼是什么意思| 流汗太多对身体有什么危害| 鸡血藤有什么作用| 胰尾显示不清什么意思| 清新的什么| 人瘦肚子大是什么原因| 心衰竭是什么症状| 汗毛长的女人代表什么| beginning什么意思| 咖位是什么意思| 布洛芬0.3和0.4g有什么区别| 冷幽默是什么意思| 羊肉馅饺子配什么菜好| 什么体质容易高原反应| 梦到黑狗是什么意思| 芒果像什么比喻句| 日加立念什么字| 精力是什么意思| 西红柿和什么榨汁减肥| 双规什么意思| 胃胀什么原因| 为什么姓张的不用说免贵| 结肠炎吃什么药效果最好| 黑乌龙茶属于什么茶| 过敏性鼻炎挂什么科室| 芹菜炒什么好吃| 别出心裁什么意思| 锦囊妙计是什么意思| 贪是什么意思| 比干是什么神| 孕妇血压低吃什么能补上来| 脖子痛是什么原因| 用劲的近义词是什么| 生日礼物送什么| 长期吃优甲乐有什么副作用| 什么样的长城| 出家人是什么意思| 淼是什么意思| 吃小龙虾不能和什么一起吃| 金光是什么生肖| 纳征是什么意思| 痱子粉和爽身粉有什么区别| 西洋参有什么用| 骨折吃什么恢复得快| 痛风吃什么水果最好| 玫瑰疹是什么病| 打嗝是什么原因引起的| 阴虱用什么药最有效| 坐骨神经痛用什么药最好| 菜场附近开什么店好| 动脉夹层是什么病| 功成名就是什么意思| 英国为什么叫日不落帝国| 西洋参泡水喝有什么功效| 考试前不能吃什么| 腊八节吃什么| 银行卡户名是什么意思| 有痰咳嗽吃什么药| 为什么一坐车就想睡觉| 大修基金什么时候缴纳| 草字头加青读什么| 电荷是什么| 肠胃炎吃什么抗生素| 猕猴桃什么时候上市| 米虫是什么意思| 胃功能四项检查是什么| 非赘生性囊肿什么意思| 感冒发烧吃什么饭菜好| 丝瓜不能和什么食物一起吃| ph是什么意思| 熬夜 吃什么| 季字五行属什么| 藕不能和什么一起吃| 竹叶青是什么茶| s代表什么意思| 急救物品五定是什么| 井底之蛙的寓意是什么| 做梦烧纸钱什么意思| 低压高吃什么降压药好| 过度是什么意思| 浠字五行属什么| 爷俩是什么意思| 活着的意义是什么| 手机壳买什么材质的好| 免疫力和抵抗力有什么区别| 什么的桌椅| s.m是什么意思| 81年属什么| 4岁属什么生肖| 7月27号是什么星座| 什么动物睡觉不闭眼| 腋下有味道是什么原因| prime是什么意思| 咳白色泡沫痰是什么病| 飞机后面的白烟是什么| 放屁臭什么原因| 什么是日记| 贝兄念什么| 升阳是什么意思| 16是什么意思| 什么样的黄河| 百度Jump to content

有什么方法可以快速入睡

From Wikipedia, the free encyclopedia
Holy grail layout with dropping footer
百度   《方案》同时提出,组建国家药品监督管理局,由国家市场监督管理总局管理,主要职责是负责药品、化妆品、医疗器械的注册并实施监督管理。

In web design, the holy grail is a web page layout which has multiple equal-height columns that are defined with style sheets. It is commonly desired and implemented, but for many years, the various ways in which it could be implemented with available technologies all had drawbacks.[1] Because of this, finding an optimal implementation was likened to searching for the elusive Holy Grail.

The limitations of CSS and HTML, the desirability of semantically meaningful pages that rank well in search engines, and the deficiencies of various browsers combined historically to create a situation in which there was no way to create this type of layout that would be considered totally correct. As the underlying technologies did not provide a proper solution, web designers found various ways to work around the limitations. Common workarounds included changes in page structure, the addition of graphics, scripting, and the creative use of CSS. These methods were imperfect, inconvenient, and considered by some to be abuse of the web standards and their intent.

More recent web standards have provided much more complete and robust solutions for implementing this layout. In particular, the CSS Flexible Box Layout and CSS Grid Layout modules have both provided full solutions.[2][3]

The problem

[edit]

Many web pages require a layout with multiple (often three) columns, with the main page content in one column (often the center), and supplementary content such as menus and advertisements in the other columns (sidebars). These columns commonly require separate backgrounds, with borders between them, and should appear to be the same height no matter which column has the tallest content. A common requirement is that the sidebars have a fixed width, with the center column adjusting in size to fill the window (fluid or liquid layout). Another common requirement is that, when a page does not contain enough content to fill the screen, the footer should drop to the bottom of the browser window instead of leaving blank space underneath.

CSS layout with floated columns and cleared footer, without holy grail features

There were many obstacles to accomplishing this:

  • CSS, although quite useful for styling, had limited capabilities for page layout.
  • The height of block elements (such as div elements) is normally determined by their content. So two divisions, side by side, with different amounts of content, will have different heights unless their height is somehow set to an appropriate value.
  • HTML is meant to be used semantically; HTML elements should be chosen which accurately describe their content. The appearance of a web page as rendered by a user agent should be determined independently by style rules. Many implementations misuse HTML by using tables for non-tabular content, or nesting multiple div elements without semantic purpose. Non-semantic use of HTML confuses users or user agents who are trying to discern the structure of the page content, and is an accessibility issue.[4]
  • As search engines may consider content in the beginning of a web page's source code to be more relevant, and content is read in source code order when viewed by some user agents such as screen readers, web designers desire the ability to place the content in the page source in an arbitrary order, without affecting the appearance of the page.
  • Because of incorrect rendering of content by different browsers, a method that works in a standards-compliant browser may not work in one that does not implement CSS correctly.

Known workarounds

[edit]

Tables

[edit]

Before the widespread implementation of CSS, designers commonly used tables to lay out pages. Sometimes they achieved their desired layout by nesting several tables inside each other. Although placing the columns inside table cells easily achieves the desired visual appearance, using a table is semantically incorrect, although the "role" WAI-ARIA HTML attribute can be set to "presentation" to regain semantic context. There is also no way to control the order of the columns in the page source.

Divisions with display:table

[edit]

It is possible to make columns equal height using the CSS display property.[5] This requires nested container divisions that are set to display: table and display: table-row, and columns that are set to display: table-cell. This is semantically correct, as only the display is affected. However, this method lacks the ability to control the order of the source code. It will also not work with some older, unsupported browsers, such as Internet Explorer 7.

Faux columns

[edit]

This method uses a background image which provides the background colors and vertical borders of all three columns.[6] The content of each column is enclosed in a division, and positioned over its background using techniques such as floats, negative margins, and relative positioning. The background is normally only a few pixels high, and is made to cover the page using the "repeat-y" attribute. This works fine for fixed-width layouts, and can be adapted for percentage-based variable-width pages, but cannot be used for fluid center pages.

JavaScript

[edit]

In this method, after the page is loaded, a script measures the height of each of the columns, and sets the height of each column to the greater value. This will not work in browsers that do not support JavaScript, or have JavaScript disabled.

Fixed or absolute positioning

[edit]

In this method, the corners of the column divisions are locked in a specific place on the page.[7] This may be acceptable or even desired, but does not solve the holy grail problem as it is a significantly different layout. The consequences of this method may include having content appearing below the columns (such as a footer) fixed at the screen bottom, blank space under the column content, and requiring scrollbars for each column to view all the content.

Nested divisions

[edit]

A division with its background will grow in height to contain its content. This behavior is used to solve the problem by creating three divisions nested inside each other which provide the three backgrounds. These divisions are placed in their proper location using positioning techniques, and the three content divisions are placed inside the innermost background division, positioned over their respective backgrounds. The background divisions then become as tall as the tallest content division. The drawbacks of this method include the three non-semantic divisions, and the difficulty of positioning the elements of this complex layout.[8]

Border color

[edit]

A simpler version of the nested division method entails using a single container division. The background properties of this division provide the background of the center column, and the left and right borders, which are given widths equal to the side column widths, provide the background colors of the sidebars. The content of each column is positioned over its background. This method still uses one non-semantic division, and makes it difficult to apply background images and borders to the sidebars.[9]

Bottom padding

[edit]

By placing a large amount of padding at the bottom of the column container, the background will extend far below the column content. A corresponding negative margin will bring content below the columns back into its proper position. Positioning is simple in this method, as the container of a column's content also contains its background. A padding value of 32767px is the largest that will be recognized by all modern browsers. If the difference in column heights is greater than this, the background of the shorter column will not fully fill the column.[10]

Current solutions

[edit]

The CSS3 standards contain modules which can properly lay out page elements. Two of these fully solve the holy grail problem.[1][11] Support for these modules is lacking or otherwise deficient in older browsers. Many designers will implement these modules while providing compatible styling for older browsers, which will be overridden in modern browsers by the new syntax. Support for older browsers became less important in 2020, when extended support for Windows 7 ended, and use of Internet Explorer became less common.

CSS Flexible Box Layout (Flexbox)

[edit]

The World Wide Web Consortium (W3C) has approached the layout issue through various proposals. The most mature proposal is the Flexible Box Layout Module (a.k.a. Flexbox), which is in Candidate Recommendation status as of November 2018.[12] The Flexible Box Layout Module is supported in all modern browsers.[13]

Setting an element's display property to display: flex or display: inline-flex causes the element to become a new type of container (similar to a block or inline block, respectively), with new methods of positioning child objects. The W3C proposal contains an example which achieves the holy grail column layout using four simple CSS rules, and makes the layout responsive with a simple media query rule. The module can also be used to address many other layout issues.

CSS Grid Layout

[edit]

The Grid Layout Module similarly allows a designer to create a container for layout, which contains rows and columns of fixed or variable size into which elements can be placed. It is in Candidate Recommendation status, with a new draft as of March 2025.[14] It is supported in all modern browsers except Opera Mini.[15] This module is a continuation of previous work done as the Grid Positioning Module, Template Layout Module, and Advanced Layout Module.[16]

One feature of this module is the ability to create grid slots in a container semi-graphically, in a manner that has been described as "ASCII art", as in the superseded Template Layout module. For example, the following defines a page layout grid with a full width header, three columns, and a full width footer (additional css rules are needed to size the grid items).

body { display: grid;
       grid: "h h h"
             "l c r"
             "f f f";
}

Although the Flexible Box module is capable of performing 2-dimensional page layout, its intended purpose is to position elements primarily along a single axis. Grid Layout is preferred for laying out complex pages, and pages whose layout varies greatly in a responsive design.[17]

History

[edit]

In 2001, Rob Chandanai from BlueRobot[18] pioneered the first three-column flanking design using pure CSS for the website wrongwaygoback.com. Prior to this innovation, Neale Talbot relied on JavaScript for positioning the right-hand column. Chandanais's breakthrough provided a more elegant solution that eliminated the need for scripting, simplifying layout creation.

This design approach was later nicknamed "The Holy Grail" by Eric Costello of Glish.com,[19] highlighting its significance in web development. This milestone not only showcased the power of CSS for complex layouts but also inspired countless designers to explore the full potential of cascading style sheets in their projects, marking a notable shift in web design practices.

See also

[edit]

References

[edit]
  1. ^ a b .appendTo: Solving the Holy Grail Layout
  2. ^ "Holy Grail Layout — Solved by Flexbox — Cleaner, hack-free CSS". philipwalton.github.io. Retrieved 2025-08-04.
  3. ^ "The Holy Grail Layout with 5 Lines of CSS". CSS-Tricks. Retrieved 2025-08-04.
  4. ^ "HTML Standard". html.spec.whatwg.org.
  5. ^ "Build Internet: Four Methods to Create Equal Height Columns". Archived from the original on 2025-08-04. Retrieved 2025-08-04.
  6. ^ Cederholm, Dan (January 9, 2004). "Faux Columns". A List Apart.
  7. ^ "Tableless layout HOWTO". www.w3.org.
  8. ^ "Equal-Height Columns (CSS Grid, Flexbox, & Table Methods)". Matthew James Taylor.
  9. ^ Pearce, Alan (August 6, 2008). "Multi-Column Layouts Climb Out of the Box". A List Apart.
  10. ^ "CSS Equal Height Columns: Practical Guide With Code Examples". www.positioniseverything.net. December 15, 2021.
  11. ^ "Holy Grail Layout — Solved by Flexbox — Cleaner, hack-free CSS". philipwalton.github.io.
  12. ^ "CSS Flexible Box Layout Module Level 1". www.w3.org.
  13. ^ "Can I use... Support tables for HTML5, CSS3, etc". CanIUse.com. Retrieved 2025-08-04.
  14. ^ "CSS Grid Layout Module Level 1". www.w3.org.
  15. ^ "CSS Grid Layout (level 1) | Can I use... Support tables for HTML5, CSS3, etc". caniuse.com.
  16. ^ Bos, Bert; Acebal, César (March 26, 2015). "CSS Template Layout Module". www.w3.org.
  17. ^ "Why Flexboxes Aren't Good for Page Layout — Tab Completion". www.xanthir.com.
  18. ^ "Blue Robot | Messaging, Chat Bots & Social Experiences". www.bluerobot.com. Archived from the original on April 25, 2013.
  19. ^ "Glish.com Layout Techniques – 3 columns, The Holy Grail". Archived from the original on 2025-08-04. Retrieved 2025-08-04.
手电筒的金属外壳相当于电路中的什么 佛跳墙属于什么菜系 nary是什么牌子的手表 女人为什么会得霉菌 化胡为佛是什么意思
maby什么意思 额头上长痘痘是什么原因 淀粉酶偏高是什么原因 伤感是什么意思 查淋巴挂什么科
翡翠a货是什么意思 回民不吃什么 关羽的武器叫什么 中位数是什么 容易流鼻血是什么原因
晟怎么读什么意思 什么叫体位性低血压 吃什么蔬菜对眼睛好 h代表什么单位 脖子肿是什么原因
血糖突然升高是什么原因hcv8jop7ns1r.cn 佐匹克隆片是什么药hcv9jop4ns7r.cn 圆脸适合什么短发发型hcv9jop4ns9r.cn 什么心什么目xinmaowt.com 颈动脉彩超挂什么科hcv9jop5ns1r.cn
上海手表什么档次hcv8jop7ns2r.cn 小s和黄子佼为什么分手hcv8jop7ns1r.cn 单宁是什么意思hcv9jop7ns4r.cn 吃什么最健康hcv8jop2ns0r.cn 印度人为什么叫阿三hcv8jop9ns5r.cn
低血压吃什么食物好hcv9jop4ns7r.cn 神经系统是由什么组成的hcv9jop1ns3r.cn 慢性咽喉炎什么症状hcv8jop6ns3r.cn 家里有壁虎是什么原因hcv8jop1ns5r.cn 球蛋白有什么作用和功效hcv9jop3ns0r.cn
世侄是什么意思hcv7jop5ns5r.cn 笄礼是什么意思hcv7jop6ns6r.cn 低血压是什么原因造成的hcv9jop3ns6r.cn 朱元璋什么星座hcv8jop5ns8r.cn 海参和辽参有什么区别hcv8jop3ns8r.cn
百度