详解HTML5语义化标签

详解HTML5语义化标签

  1. <header>头部标签

  2. <nav>导航标签

  3. <article>内容标签

  4. <section>块级标签

  5. <aside>侧边栏标签

  6. <footer>尾部标签

    注意:

    1. 语义化标签主要针对于搜索引擎
    2. 新标签在页面中可以使用多次
    3. IE9中,需要把这些元素转换为块级元素
    4. 移动端使用这些标签较多
header,
        nav,
        article,
        section,
        aside,
        footer {
            display: block;
        }
         header {
            height: 80px;
            background-color: aqua;
            line-height: 80px;
            text-align: center;
        }
        nav {
            margin-top: 10px;
            height: 80px;
            background-color: bisque;
            line-height: 80px;
            text-align: center;
        }
        article {
            float: left;
            margin-top: 10px;
            width: 50%;
            height: 300px;
            background-color: cadetblue;
        }
        section {
            float: left;
            width: 300px;
            height: 80px;
            background-color: chartreuse;
            margin: 40px auto;
        }
        
        aside {
            float: right;
            margin-top: 10px;
            width: 50%;
            height: 300px;
            background-color: coral;
        }
        footer {
            float: left;
            width: 100%;
            height: 80px;
            background-color: darkkhaki;
            margin-top: 10px;
        }
<body>
	<header>header</header>
	<nav>nav</nav>
	<article>article<section>section</section></article>
	<aside>aside</aside>
	<footer>footer</footer>
</body>

在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/Angela_Connie/article/details/110122483
今日推荐