Search code examples
cssxhtmlhtmlsemantic-markup

What is the logic behind to use Semantic meaningful markup?


Is it only for screen reader software? because browser renders both type of tags semantic and presentational in same manner.

For example:

for browser for us and for css <strong> and <b> is same. what is the purpose to semantic tag over presentational tag.

is it for screen readers only or it's for better management of code?

if it's for developer strong and b both can produce same result on browser.


Solution

  • Semantic markup allows scripts to understand context. This may be beneficial for screen reader software, but it will also be beneficial for Google and other search bots.

    According to HTML specs, <strong> and <em> communicate emphasis, whereas <b> and <i> simply mean "display bold" and "display italic". <b> and <i> should be used in instances where emphasis is specifically not desired. For example, when italicizing a book title.

    When search bots are trying to gain semantic understanding of content, it is reasonable to assume they give greater preference to semantic tags.