2014年1月17日 星期五

Image replacement by css 用純CSS方法換掉 圖片

original: http://www.audenaerde.org/csstricks.html#

CSS:
img.imgClick{  
    height: 0;
    width: 0;
    padding: 17.5px;
    background: url("camera_35x35_MD.png") repeat scroll 0 0 rgba(0, 0, 0, 0);
}

HTML:

<img class="imgClick" src="camera_35x35.png">


CSS Tips:
1. use CSS height & width hide the html img
2. padding make the background space
3. css background attribute is appear

沒有留言:

張貼留言