Explain HTML5 semantic tags in detail

Explain HTML5 semantic tags in detail

  1. <header>Header tag

  2. <nav>Navigation tab

  3. <article>Content label

  4. <section>Block label

  5. <aside>Sidebar label

  6. <footer>Tail tag

    note:

    1. Semantic tags are mainly for search engines
    2. The new label can be used multiple times in the page
    3. In IE9, these elements need to be converted into block-level elements
    4. These tags are used more on mobile
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>

Insert picture description here

Guess you like

Origin blog.csdn.net/Angela_Connie/article/details/110122483