开发者

How does Reddit display anchor tags as images?

开发者 https://www.devze.com 2023-02-12 00:17 出处:网络
Example here: http://www.reddit.com/r/fffffffuuuuuuuuuuuu/comments/fn9e7/the_best_thing_about_walking_to_scho开发者_运维知识库ol/c1h7af4

Example here: http://www.reddit.com/r/fffffffuuuuuuuuuuuu/comments/fn9e7/the_best_thing_about_walking_to_scho开发者_运维知识库ol/c1h7af4

I tried to peek into the DOM via Firebug but I couldn't find a reference to the images. I only found that the href attribute of the anchor tags decides what image will be displayed. This is something new to me. How does this work?


It's a CSS background-image in the :after pseudo-selector.


Like slaks says, it's a background image. Like so:

<a href="link.html" style="width:100px; height:100px; background-image:url('image.jpg');"></a>
0

精彩评论

暂无评论...
验证码 换一张
取 消