HTML Introduction
HTML stands for HyperText Markup Language and is the language used to create web pages. It is the basis of every single page on the web. Developed by the British physicist Tim Berners-Lee in 1990, the language has gone through lots of versions, with the latest being HTML5.
The anatomy of a page
A web page consists of basically three elements: the head, the body and the footer wrapped around the HTML tag.
A basic example of a web page's anatomy is depicted below.
Page Title
Heading
Section Heading
Section content goes here...
Another Section Heading
More section content goes here...
Now, Let's break down each of these elements:
,
and
HTML semantic refers to the use of standard HTML elements to convey the meaning and structure of the content on a web page. In other words, it's the practice of using HTML elements to describe the purpose and role of the different parts of a web page, rather than just using generic divs and spans.
For example, instead of using a div element to create a header section, you would use the semantic header element. Similarly, you would use the semantic section element to group related content, and the semantic nav element to create a navigation bar.
Using semantic HTML has several benefits, including:
Accessibility: Screen readers and other assistive technologies rely on semantic HTML to properly interpret the content and provide an optimal experience for users with disabilities.
SEO: Search engines can better understand the content of a page when it's marked up semantically, which can improve the page's ranking in search results.
Maintainability: Semantic HTML makes it easier to understand the structure of a web page, which can make it easier to maintain and update the code over time.
Overall, using semantic HTML is an important best practice for building accessible, SEO-friendly, and maintainable web pages.