Semantics and sensibility – Web Performance and Site Speed Consultant

  • Home
  • WEBSITES
  • Semantics and sensibility – Web Performance and Site Speed Consultant
May 18, 2025


Written by on CSS Wizardry.

Table of Contents
  1. Insemantic code
  2. Insensible code
  3. Semantics concerns itself with elements…
    1. Be sensible, for our sake
  4. Final word

For a while now, sensible naming conventions and semantics have been confused.
Things such as class="left" or class="clear" have been deemed insemantic,
whereas in reality, semantics really doesn’t stretch that far… Let me illustrate
with some code examples:

Insemantic code

The following code is just plain wrong, it’s insemantic, using the wrong elements for the wrong job:



About

This is some page text about some stuff...

Insensible code

This code is perfectly semantic, it just uses some silly classes:

Semantics concerns itself with elements…

…and not the names assigned to them. Using the correct element for the correct
job is as far as semantics goes. Standards concerning naming of those elements
is all about sensibility.

Semantics sets a standard from which it is very difficult to stray. Headings are
marked up with a , a list with and so on. You cannot,
however, define a convention for naming the IDs and classes of these.



Source link

Leave a Reply