0

As long as you preserve the separation of meaning (using classes and ids) and presentation (css), why not just use span and div exclusively?

anonymous
  • 153
  • 5

2 Answers2

4

That would defeat the entire purpose of a semantic markup language. You would be abusing HTML solely for the purpose of presentation. It's like structuring your thoughts only in terms of emphasis and sound, and without any concern for the meaning.

It is the meaning that is fundamental to a thought, or to a piece of a document. The presentational details are a consequence of that meaning, not the other way round. You can choose to present a certain document in different ways once you understand its structure, but you cannot recover the nuances of the meaning from any given piece of presentation. So the richer, semantic structure is the one that should be recorded, and the presentational realisation should be worked out when the document is actually being presented.

Kerrek SB
  • 464,522
  • 92
  • 875
  • 1,084
  • I would be clearly indicating the meaning with the classes and ids. How would meaning be lost? – anonymous Oct 29 '12 at 22:10
  • @anonymous: Then you'd just be inventing your own language *inside* the existing language of HTML. Sure, you *could* do that, but it'd be no more useful than making up new words for everything around you in English. Mutual intelligibility and communication favours the use of a single, common language. – Kerrek SB Oct 29 '12 at 22:11
1

It is not just a matter of writing clean HTML and CSS. When you use standard tags instead of just spans and divs, you automatically indicate to search engines and other automated tools what your elements mean.

For instance, while you could in principle define your own span for emphasized text, using em is better; search engines could for instance use that information to conclude that this part of the document is meant to describe something important. Similarly, almost all websites have a header, a footer and a navigation bar. Automated tools can use such information to detect e.g. internal navigation links and index them differently.

Philippe
  • 9,582
  • 4
  • 39
  • 59