Define an <img>'s src attribute in CSS

Massimo Ugues picture Massimo Ugues · Apr 20, 2010 · Viewed 405.3k times · Source

I need to define an <img>'s src attribute in CSS. Is there a way to specify this attribute?

Answer

Marinos picture Marinos · Jul 23, 2012

just this as img tag is a content element

img {
    content:url(http://example.com/image.png);
}