HTML
ZhangLargeCake
搬砖前端,张大饼
展开
-
img图片加载失败处理方式
图片加载失败后css样式处理方式 <img src="a.png" alt="图片的描述内容" onerror="this.classList.add('error')" >对应上方的img,当加载失败时,触发onerror事件,为便签添加类名.error使用 img.error 优化加载失败的图片优化如下<style> img.error { position:relative; display:inline-block; } img.error:b原创 2021-04-07 16:12:57 · 1930 阅读 · 0 评论 -
CSS 盒子滚动条滚动优化
CSS 盒子滚动条滚动优化滚动条流畅丝滑.box{ scroll-behavior:smooth;}原创 2021-04-07 15:57:12 · 311 阅读 · 0 评论