DEV Community

[Comment from a deleted post]
Collapse
 
bartosz profile image
Bartosz Wójcik

Don't use H1-H6 headers? Using ::after selectors instead of a simple and basic CSS cascading rules? Spamming the alt tags with as much bloat as possible? These aren't good ideas at all.

Collapse
 
ashleyjsheridan profile image
Ashley Sheridan

I don't think that's what he means at all. He's advising to not use headings for non-heading content. The examples aren't the best, but the meaning is clear if you read the rest of that section.

He uses pseudo elements to draw non-content visual items. That's absolutely fine. We shouldn't use extra HTML markup to achieve this sort of thing.

The alt attributes (not tags) aren't being stuffed with bloat. Those attributes should be a replacement for the image when it cannot be seen (such as for blind users, or those on slow/metered connections). By not putting an accurate replacement in here is doing your visitors a disservice. It's important to note that alt text is not the same thing as a description. A good test is to remove the image from the content, replace it with the alt attribute text, and see if the overall content still makes sense. If the replaced image content doesn't, you probably need to fix it.