<img src="zxx.png" alt="CSS新世界封面" onerror="this.classList.add('error');" width="100" height="100"> <img src="https://www.zhangxinxu.com/study/202010/street.jpg" alt="CSS新世界封面" onerror="this.classList.add('error');" width="100" height="100">
<style> img.error { display: inline-block; transform: scale(1); content: ''; color: transparent; } img.error::before { content: ''; position: absolute; left: 0; top: 0; width: 100%; height: 100%; background: #f5f5f5 url(https://www.zhangxinxu.com/study/202010/break.svg) no-repeat center / 50% 50%; } img.error::after { content: attr(alt); position: absolute; left: 0; bottom: 0; width: 100%; line-height: 2; background-color: rgba(0,0,0,.5); color: white; font-size: 12px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } </style>
最后一屏底部自动高度的方法为 slidesPerView:auto, css代码 .foot{height:auto!important;} 但是这种情况会出现滚动到最后一屏的
Swiper默认的切换时间曲线是ease,可以通过添加css3的transition-timing-function属性来改变。 改变Swiper切换的时间曲线 .swi
pagination为不同的图片,可滑动,支持点击 varmySwiper=newSwiper(.swiper-container,{pagination:{el:.swiper-pagination,type:custom,renderCu
主要有两种填充效果。 第一种是通过css的动画效果,当轮播开始时,添加动画事件,思路如下 .swiper-pagination-bullet-ac
AI图标制作完成之后,保存的svg文件包含许多AI的信息,如果要在HTML中使用,我们需要在svg文件中提取/修改信息,重
body{-webkit-user-select:none;-moz-user-select:none;-o-user-select:none;user-select:none;} 这段CSS千万不能放在*{}里面,不然会出现In