Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Author here. What advice is "bad" in your estimation?

As for not following my own advice, that's not quite right. I'm using picture and img tags rather than div's with CSS background-image, which is the main thrust of the article.

I'm also using srcset for performance, and webp as a progressive enhancement for browsers that support it.

The only thing I'm not doing is using the new loading="lazy" because the website was creating long before the article.



Given that all the images in the article are purely decorative, why you using picture and img tags rather than CSS background-image? You're also supplying alt attributes, so someone with a screen reader will hear a random "Bad boy doggo" in the middle of an article about HTML and CSS.


Agreed; if the images are purely decorative (some are, some are not) then it should have an empty `alt=""` to have screen readers skip them.

But I would still want to use an actual picture element with srcset & source attributes/tags for the reasons mentioned in the article.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: