ArticleslgStudy

science

Semantic HTML

Semantic HTML is a science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Semantic HTML rather than just read about it. In short: Semantic HTML is the use of HTML markup to reinforce the semantics, or meaning, of the information in web pages and web applications rather than merely to define its presentation or look. Semantic HTML is processed by conventional web browsers as well as by many other user agents.

Semantic HTML — main illustration
Semantic HTML — illustration

Key takeaways

  • Semantic HTML belongs to science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Semantic HTML to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Semantic HTML from memory before moving on to harder problems.

Reference excerpt

Semantic HTML is the use of HTML markup to reinforce the semantics, or meaning, of the information in web pages and web applications rather than merely to define its presentation or look. Semantic HTML is processed by conventional web browsers as well as by many other user agents. CSS is used to suggest how it is presented to human users.

History HTML has included semantic markup since its inception. In an HTML document, the author may, among other things, "start with a title; add headings and paragraphs; add emphasis to [the] text; add images; add links to other pages; [and] use various kinds of lists". Various versions of the HTML standard have included presentational markup such as <font> (added in HTML 3.2; removed in HTML 4.0 Strict), <i> (all versions) and <center> (added in HTML 3.2). There are also the semantically neutral span and div elements. Since the late 1990s when Cascading Style Sheets were beginning to work in most browsers, web authors have been encouraged to avoid the use of presentational HTML markup with a view to the separation of content and presentation.

Prospects for autonomous agents and web crawlers In 2001, Tim Berners-Lee participated in a discussion of the Semantic Web, where it was presented that intelligent software 'agents' might one day automatically crawl the Web and find, filter and correlate previously unrelated, published facts for the benefit of end users. Such agents are not commonplace even now, but some of the ideas of Web 2.0, such as mashups and price comparison websites approximate it, and developments in agentic AI have the potential to make progress in this area. The main difference between these web application hybrids and Berners-Lee's semantic agents lies in the fact that the current aggregation and hybridisation of information is usually designed in by web developers, who already know the web locations and the API semantics of the specific data they wish to mash, compare and combine. An important type of web agent that does crawl and read web pages automatically, without prior knowledge of what it might find, is the web crawler or search-engine spider. These software agents are dependent on the semantic clarity of web pages they find as they use various techniques and algorithms to read and index millions of web pages a day and provide web users with search facilities. In order for search-engine spiders to be able to rate the significance of pieces of text they find in HTML documents, and also for those creating mashups and other hybrids, as well as for more automated agents as they are developed, the semantic structures that exist in HTML need to be widely and uniformly applied to bring out the meaning of published information.

Overall semanticity of web architecture While the true semantic web may depend on complex RDF ontologies and metadata, every HTML document makes its contribution to the meaningfulness of the Web by the correct use of headings, lists, titles and other semantic markup wherever possible. This "plain" use of HTML has been called "Plain Old Semantic HTML" or POSH. The correct use of Web 2.0 'tagging' creates folksonomies that may be equally or even more meaningful to many. HTML 5 introduced new semantic elements such as <section>, <article>, <footer>, <progress>, <nav>, <aside>, <mark>, and <time>. Overall, the goal of the W3C is to slowly introduce more ways for browsers, developers, and crawlers to better distinguish between different types of data, allowing for benefits such as better display on browsers on different devices. Presentational elements were not formally deprecated in HTML 4.01 and XHTML recommendations, but were recommended against. In HTML 5, some of those elements, such as <i> and <b>, are still specified as their meaning has been clearly defined "as to be stylistically offset from the normal prose without conveying any extra importance".

Considerations In cases where a document requires more precise semantics than those expressed in HTML alone, fragments of the document may be enclosed within span or div elements with meaningful class names such as <span class="author"> and <div class="invoice">. Where these class names are also a fragment identifier within a schema or ontology, they may link to a more defined meaning. Microformats formalise this approach to semantics in HTML. One important restriction of this approach is that such markup based on element inclusion must meet the well-formedness conditions. As these documents are broadly tree-structured, this means that only balanced fragments from a sub-tree can be marked up in this way. A means of marking-up any arbitrary section of HTML would require a mechanism independent of the markup structure itself, such as XPointer. Good semantic HTML also improves the accessibility of web documents (see also Web Content Accessibility Guidelines). For example, when a screen reader or audio browser can correctly ascertain the structure of a document, it will not waste the visually impaired user's time by reading out repeated or irrelevant information when it has been marked up correctly.

Google "rich snippets" In 2010, Google specified three forms of structured metadata that their systems will use to find structured semantic content within webpages. Such information, when related to reviews, people profiles, business listings, and events will be used by Google to enhance the "snippet", or short piece of quoted text that is shown when the page appears in search listings. Google specifies that that data may be given using microdata, microformats or RDFa. Microdata is specified inside itemtype and itemprop attributes added to existing HTML elements; microformat keywords are added inside class attributes as discussed above; and RDFa relies on rel, typeof and property attributes added to existing elements.

See also

CP/LD (Content Profile/Linked Document) HTML elements (complete list) HTML landmarks Microdata (HTML) Microformat RDFa schema.org is an initiative launched on 2 June 2011 by Bing, Google and Yahoo! Semantic Web Semantics (computer science) XML

References

Illustrations

Semantic HTML: HTML element content categories
HTML element content categories

Worked examples

Example 1 — a first encounter with Semantic HTML

Start with the simplest possible case. Write down what Semantic HTML claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Semantic HTML before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Semantic HTML ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Semantic HTML

In research
Semantic HTML appears in science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Semantic HTML in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Semantic HTML is common in secondary-school and first-year university syllabi. It links to neighbouring topics Domain-specific knowledge representation languages, Semantic HTML, Web accessibility, so understanding it makes those chapters shorter.
In everyday life
Look for Semantic HTML outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Semantic HTML” →

How to study Semantic HTML in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Semantic HTML means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Semantic HTML out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Semantic HTML in simple terms?

Semantic HTML is the use of HTML markup to reinforce the semantics, or meaning, of the information in web pages and web applications rather than merely to define its presentation or look. Semantic HTML is processed by conventional web browsers as well as by many other user agents.

Why does Semantic HTML matter?

Because it connects several science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Semantic HTML?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Semantic HTML.

Tags

  • Domain-specific knowledge representation languages
  • Semantic HTML
  • Web accessibility
  • Web design

Keep exploring