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

TBH, I hate these kinds of articles. Instead of titling it something like "Things to be aware of with CSS background-image", or even the catchier "Don't use CSS background-image for a foreground image", it uses a much broader, click-baity unwarranted title about "anti-pattern".

I'm glad that background-images aren't indexed by search engines, or made available to screen readers, and I obviously know they aren't downloaded before the CSS that references them is. I think all of those as good things, because I use background-image just for that - things that not primary. When I print, if excluding background images makes the page unreadable, I think of it as using background images wrong.

Calling a widely used, useful feature an "anti-pattern" just because some people may use it wrong is ludicrous.



Ok, but the title isn't the article, and there are other things to discuss here.

https://news.ycombinator.com/item?id=20545932


Well, it is a common anti pattern, in the way it’s usually used. A quick search on github for uses corroborates this.


It may be an anti-pattern, but is it considered harmful?


At the very least it's user-hostile, if I want to save the image I would have to inspect element and open the URL in a new tab, rather than just Right Click > Save Image as...


Uh? Your parent comment was referring to often ill suited "X considered harmful" type of articles.


The Problem with Article Titles


background-image the hard way


learn you a background-image




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

Search: