How to change the Img tag src through css only? -


how can replace image tag src value through css ? , want support in ie8 ,firefox ,chorme,safari

<div class="any">  <img src="images/i.png"/> </div> 

replace src value through css only.

thanks

try setting background image , moving (with padding) out of box original image

something this...

edit had tweak bit have working...

.any img {   display: block;   -moz-box-sizing: border-box;   box-sizing: border-box;   background: url(http://placehold.it/150) no-repeat;   width: 150px;    height: 150px;     padding-left: 150px;  } 

... , here working example http://jsfiddle.net/nnarn/1/


Comments

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

css - Firefox for ubuntu renders wrong colors -