Skip to main content

Markup Languages: 5. Semantic HTML

Markup Languages
5. Semantic HTML
    • Notifications
    • Privacy
  • Project HomeTools and Techniques in Software Engineering
  • Projects
  • Learn more about Manifold

Notes

Show the following:

  • Annotations
  • Resources
Search within:

Adjust appearance:

  • font
    Font style
  • color scheme
  • Margins
table of contents
  1. Markup Languages
  2. 1. Grammar of HTML
  3. 2. Organizing HTML
  4. 3. Dialects
    1. 3.1. HTML
    2. 3.2. XML
    3. 3.3. XHTML
  5. 4. Attributes
  6. 5. Semantic HTML
  7. 6. Developing with HTML
  8. 7. Evolution
  9. 8. Bibliography

Semantic HTML

Semantics refers to the meaning of an item. Semantic HTML refers to specifying elements that gives meaning around text. For example, you could specify a top level heading with the <h1> tag which is known as the top level tag.

<h1>This is a top level heading</h1>

With HTML you can defined the style with any, so for example to replicate the above tag in the browser you can use a different set of tag and style attributes.

<span style="font-size: 32px; margin: 21px 0;">Is this a top level heading?</span>

This will render it to look like a top level heading, but it has no semantic value.

Benefits from writing semantic markup:

  • Search engines will consider its contents as important keywords to influence the page's search rankings (see SEO)
  • Screen readers can use it as a signpost to help visually impaired users navigate a page
  • Finding blocks of meaningful code is significantly easier than searching though endless divs with or without semantic or namespaced classes
  • Suggests to the developer the type of data that will be populated
  • Semantic naming mirrors proper custom element/component naming

Annotate

Next Chapter
6. Developing with HTML
PreviousNext
Web Technology
Powered by Manifold Scholarship. Learn more at
Opens in new tab or windowmanifoldapp.org