Date First Published: 12th November 2022
Topic: Web Design & Development
Subtopic: Web Development
Article Type: Computer Terms & Definitions
Difficulty: MediumDifficulty Level: 6/10
Learn more about what semantic markup is in this article.
Semantic markup, also known as semantic HTML is the use of HTML markup to effectively describe the meaning and purpose of page elements. The word 'semantic' means a word or sentence properly connected with the meaning. This can be applied to HTML as semantic markup is HTML tags that are used in a way that is properly connected with the meaning of the words used in the tags and say what they actually do. Most HTML tags are semantic as the name of the tag contains some information about the type of content found between the opening and closing tags.
Semantic HTML markup specifies the meaning of different tags to users and computers. Semantic HTML tags also have names that tell the person or computer reading the markup exactly what they do.
Examples of semantic tags are:
With the release of HTML5, lots of new tags were added to provide semantic meaning to the elements and define different parts of a webpage. A lot of the semantic tags came from the analysis of webpage markup performed by companies, such as Opera and Google. They found that a lot of websites use id and class attributes to specify the meaning of the contents of non-semantic elements, such as '<div id="footer">' and '<div class="heading">'. These findings helped the W3C to identify and target new semantic tags to include in HTML5. What these tags define is very obvious. Examples include:
Examples of non-semantic tags are:
The benefits of semantic tags are:
Screen readers rely on semantic tags to identify the elements of the HTML document and provide accessibility features, which is helpful for users with visual impairments or users who find it difficult to use a mouse. Visiting a webpage using a screen reader can be difficult if a webpage does not use semantic markup. For example, if a webpage is completely structured using <div> and <span> tags, it will be unclear to those who cannot see the page how the sections relate to each other. Semantic tags divide a page into separate parts.
Another example of an accessibility feature is that some semantic elements come with built-in keyboard accessibility. When a screen reader detects a <table> element, users can use special keyboard controls to move up and down rows and across columns. This cannot be accomplished with a <div> tag as this tag does not tell the screen reader that this element acts as a table. Writing semantic HTML can enable additional accessibility features on a website.
Semantic markup helps search engine bots get a better understanding of the structure and contents of a page, which is good for SEO. It tells them what content is important on a page. For example, keywords within a <h1> tag indicate much more important than the <p> tag as the <h1> tag indicates the main title of the page rather than a block of text, which is what the <p> tag indicates.
Semantic markup will make HTML tags easier to understand, more organised, and easier to locate. Without semantic markup, developers would have to look through a large number of <div> or <span> tags, which is time-consuming.
If so, it is important that you tell me as soon as possible on this page.
Network Services Network Setups Network Standards Network Hardware Network Identifiers Network Software Internet Protocols Internet Organisations Data Transmission Technologies Web Development Web Design Web Advertising Web Applications Web Organisations Web Technologies Web Services SEO Threats To Systems, Data & Information Security Mechanisms & Technologies Computer Hardware Computer Software Ethics & Sustainability Legislation & User Data Protection