是否确定样式的< HTML和GT;标签? [英] Is it OK to style the <html> tag?

查看:305
本文介绍了是否确定样式的< HTML和GT;标签?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有时候你想要两个身体的背景。一个用于头和一个用于页脚。
我意外地发现,这是可能的样式实际< HTML方式> 标签

Sometimes you want two body backgrounds. One for the header and one for the footer. I accidentally discovered that it is possible to style the actual <html> tag.

HTML

<html xmlns="http://www.w3.org/1999/xhtml">

CSS:

html {background:#000}

是否确定此样式,还是会造成什么问题呢?

Is it OK to style this, or will it cause any problem?

推荐答案

虽然这是值得商榷至于是否是有效的 [见这里]

Although it's debatable as to whether it's valid [see here]:

有关HTML文档,但是,我们推荐作者指定
  背景BODY元素,而不是HTML元素。 ...

For HTML documents, however, we recommend that authors specify the background for the BODY element rather than the HTML element. ...

很多大型网站仍然看似一致的结果使用它。

Many large sites still use it with seemingly consistent results.

这篇关于是否确定样式的&lt; HTML和GT;标签?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆