方法一:设置失败图片
.error-image { background-image: url('images/error-image.jpg'); background-size: cover; width: 240px; height: 180px; }
方法二:设置失败文字
.error-text { position: relative; width: 240px; height: 180px; } .error-text::before { content: '图片加载失败'; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); }
Motion Vue:无需编写复杂的命令式代码,轻松实现动画效果
ButtonsGenerator:一个免费的CSS按钮在线生成工具
汇聚全网热榜API,包括百度/微博/哔哩/抖音/今日头条/百度贴吧等等
上面是“img图片不存在如何利用css设置error”的全面内容,想了解更多关于 前端知识 内容,请继续关注web建站教程。
当前网址:https://m.ipkd.cn/webs_12801.html
声明:本站提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请发送到邮箱:admin@ipkd.cn,我们会在看到邮件的第一时间内为您处理!