我需要在 CSS 中定义一个 <img> 的 src 属性.有没有办法指定这个属性?
I need to define an <img>'s src attribute in CSS. Is there a way to specify this attribute?
#divID {
background-image: url("http://imageurlhere.com");
background-repeat: no-repeat;
width: auto; /*or your image's width*/
height: auto; /*or your image's height*/
margin: 0;
padding: 0;
}
这篇关于在 CSS 中定义一个 <img> 的 src 属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!
ionic - 如何在 ion-header 中对长字符串进行自动换行ionic - How to wordwrap a long string in ion-header(ionic - 如何在 ion-header 中对长字符串进行自动换行)
如何在角度2中动态更改css类名How to change the css class name dynamically in angular 2(如何在角度2中动态更改css类名)
使用模态和样式的 Ionic 2 登录弹出窗口Ionic 2 login popup using Modal and styling(使用模态和样式的 Ionic 2 登录弹出窗口)
如何在ionic 3中进行水平滚动how to do horizontal scroll in ionic 3(如何在ionic 3中进行水平滚动)
与另一个离子卡重叠的虚拟滚动 ion-img 标签Virtual scroll ion-img tag overlapping to another ion card(与另一个离子卡重叠的虚拟滚动 ion-img 标签)
如何删除输入类型中的默认颜色?How to remove default color in input type?(如何删除输入类型中的默认颜色?)