Is it true that there are semantically correct & incorrect ways of displaying pictures/icons?
I mean of course it's not very friendly to include all pictures of a newspaper article as background images because that way, screen readers can't read out the alt
text, but what about icons or user interface elements? Is it justifiable from a semantic oriented point of view to include these as background-images?
Semantics in HTML In HTML, for example, the <h1> element is a semantic element, which gives the text it wraps around the role (or meaning) of "a top level heading on your page."
The HTML semantics refers to the tags that provide meaning to an HTML page rather than just presentation. It makes HTML more comprehensible by better defining the different sections and layout of web pages.
Examples of Semantic HTML5 Super simple example with the most important elements: header, footer, nav, and main.
There are some semantically correct and incorrect ways of displaying different kinds of images.
<img>
tags, because they are often the main content of a site. These should have alt
tags to inform users about important parts of content.<img>
tags because it's important for usability to show what specific icons do if it's not displayed correctly.DOM
.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With