css - 大家好,请问H5中的布局标签<header><footer><nav>是类似于div的块元素吗?
黄舟
黄舟 2017-04-17 12:07:51
0
5
889

大家好,请问H5中的布局标签 <header><footer><nav> 是类似于p的块元素吗?
比如说页面中有个header:

<header>
<h1>我的文章</h1>
<h4>hello world hello world hello world hello world</h4>
</header>

我想用css控制header,是给他加类或者是id来控制吗?谢谢!

黄舟
黄舟

人生最曼妙的风景,竟是内心的淡定与从容!

reply all(5)
阿神

In the HTML5 specification, tags such as <header><nav><footer><article> are actually <p>, and the purpose of these new tags is to better divide the overall HTML document display logical structure. For example, in the <header> tag only Defining content related to the top of the page, rather than defining the top of the page as a <p class="header">, is the main difference between these tags and <p>.

大家讲道理

is a block element. The typical behavior of block elements is to occupy one line alone. Style is controlled by class

大家讲道理

Yes,
can also be selected directly using the element selector:

header { font-weight: bold }
黄舟

Several new HTML5 tags such as

<header><footer><nav><section> are all block tags.
You can write code to see whether the effect will automatically fill a row!

左手右手慢动作

As far as I have discovered, the tags of many websites are still xhtml, and there are still very few new tags for h5, which may be from the past. But I have to say that many people still like to use xhtml standards to write . What is the reason?


I think:

  1. Even though h5 has been launched for a few years, many people still like or feel that things written in xhtml already meet the needs of writing websites and meet the standards (easier to understand), and the new h5 has made There are some changes, but many people still fail to learn quickly

  2. To completely change the old version of the webpage to h5, it will take a certain amount of time and effort

  3. H5 is compatible with various browsers. Although most modern browsers already support h5, we still have to consider the compatibility issues with lower versions of some browsers

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template