大家好,请问H5中的布局标签 <header><footer><nav>
是类似于p的块元素吗?
比如说页面中有个header:
<header>
<h1>我的文章</h1>
<h4>hello world hello world hello world hello world</h4>
</header>
我想用css控制header,是给他加类或者是id来控制吗?谢谢!
阿神2017-04-17 12:09:51
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>
.
大家讲道理2017-04-17 12:09:51
is a block element. The typical behavior of block elements is to occupy one line alone. Style is controlled by class
大家讲道理2017-04-17 12:09:51
Yes,
can also be selected directly using the element selector:
header { font-weight: bold }
黄舟2017-04-17 12:09:51
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!
ringa_lee2017-04-17 12:09:51
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:
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
To completely change the old version of the webpage to h5, it will take a certain amount of time and effort
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