WoJ
WoJ

Reputation: 30072

Are there HTML tags which are non-substituable?

When reading about HTML, I realized that most of the formatting tags (such as <bold> or <i>) seem to just be shortcuts. For instance, <b>text</b> could be replaced with <span style="font-weight: bold;">text</span>

<b>text</b>
<span style="font-weight: bold;">text</span>

I understand the idea to have shortcuts to typical formatting (though I believe that this was more useful before, when HTML was built manually and not generated from, say, Markdown) and would like to know whether there are any tags which are not substituable because they have a special meaning for rendering.

<html>, <head>, <body>, <style> and other "logistics" tags come in mind ("logistics" in the sense that they do not influence how the rendered text looks like but rather either structure the high level document (<html>, <head>, <body>) or allow extra elements to be inserted <style>, <link>, etc.)

In other words: are the formatting tags just shortcuts (and could be replaced by a styled <span> or <div>) or do they carry some special meaning?

Upvotes: 2

Views: 69

Answers (2)

Florent Arlandis
Florent Arlandis

Reputation: 935

Indeed, semantic tags such as nav, footer or section DO have a special meaning for search engine.

You can learn more here: https://www.w3schools.com/html/html5_semantic_elements.asp

Also, you should build your html based on SEO friendly only and transfer all your styling to css (avoid style attribute if possible)

Upvotes: 0

Ilya Streltsyn
Ilya Streltsyn

Reputation: 13556

HTML tags are used not only to render text on the screen. Accessibility tools and search engines' crawlers also use them to define (or at least to guess:) the meaning of the content. Some accessibility platforms have special mappings for some tags (e.g., Windows UIA platform maps the dfn element to the Accessible Object of the 'definition' type). Search engines algorithms also have different assumptions for different tags (e.g. text wrapped in strong would usually be considered more 'relevant' to the search query than text wrapped in i, and both usually would be considered more 'relevant' than text wrapped in span, regardless its styling).

Upvotes: 2

Related Questions