Semantic tags inHTML5

Semantic tags inHTML5


 HTML5 introduces a set of new semantic tags that can be used to describe the content on a web page. These tags make it easier for search engines and other software to understand the structure and meaning of the content. Some of the new tags include <header>, <footer>, <nav>, <section>, and <article>. Here's an example of how to use some of these tags:

php


<!DOCTYPE html>

<html>

<head>

<title>My Web Page</title>

</head>

<body>

<header>

<h1>Welcome to my web page</h1>

<nav>

<ul>

<li><a href="#about">About</a></li>

<li><a href="#services">Services</a></li>

<li><a href="#contact">Contact</a></li>

</ul>

</nav>

</header>

<section id="about">

<h2>About Us</h2>

<p>We are a company that specializes in web development.</p>

</section>

<section id="services">

<h2>Our Services</h2>

<ul>

<li>Web design</li>

<li>Web development</li>

<li>Search engine optimization</li>

</ul>

</section>

<footer>

<p>&copy; 2023 My Company</p>

</footer>

</body>

</html>

In this example, we use the <header> tag to define the top section of the web page, which includes a <h1> heading and a <nav> element with links to other sections of the page. The <section> tag is used to define separate sections of the page, and the <footer> tag defines the bottom section of the page, which includes a copyright notice.

No comments:

Post a Comment

The Importance of Cybersecurity in the Digital Age

 The Importance of Cybersecurity in the Digital Age Introduction: In today's digital age, where technology is deeply intertwined with ev...