更新时间:2023-10-18 21:40:52
使用 content:url("image.jpg").
content:url("image.jpg")
完整的解决方案(现场演示):
Full working solution (Live Demo):
<!doctype html> <style> .MyClass123{ content:url("http://imgur.com/SZ8Cm.jpg"); } </style> <img class="MyClass123"/>
测试和工作:
经过测试且无效:
是否可以在 CSS 中设置 img 标签的 src 属性的等效项?