CSS-造型< body>元素与样式< html>元素 [英] CSS - Styling <body> element vs. styling <html> element
本文介绍了CSS-造型< body>元素与样式< html>元素的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
优势是什么?样式化<html>
元素而不是<body>
元素的缺点?
What are the advantages & disadvantages of styling the <html>
element instead of the <body>
element?
我已经看到它在很多情况下都使用过,例如整页的背景图片,或使元素占据视口高度的100%.
I have seen it used in many cases such as in a full page background image, or to make an element take up 100% of the view port height.
...但是我确定有一些限制.您是否知道任何特定的浏览器支持问题等?
...but I'm sure there are some limitations. Do you know of any specific browser support issues etc?
推荐答案
以下是有关此问题的两篇文章:
如何在没有包装的情况下居中和布局页面
设置HTML和正文元素的样式
Here are two articles about this very thing:
How to center and layout pages without a wrapper
Styling HTML and body elements
这篇关于CSS-造型< body>元素与样式< html>元素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文