html5 - 添加了伪元素 但是查看元素看不到
问题描述
.swiper-wrapper .swiper-slide:nth-of-type(1) img:nth-child(2) { position: absolute; top: 23%; left: 45%; animation: rotate_flower1 2.5s ease-in infinite; /*animation: rotate_flower2 2.5s ease-out infinite;*/ animation-fill-mode: forwards;}.swiper-wrapper .swiper-slide:nth-of-type(1) img:nth-child(2)::after{ content: ’’; position: absolute; display: block; top: 23%; left: 45%; width: 2.5em; /*animation: rotate_flower1 2.5s ease-in infinite;*/ animation: rotate_flower2 2.5s ease-out infinite; animation-fill-mode: forwards;}


是想通过这样的方式设置两个方向的动画 叠加起来出现曲线的效果但是现在添加的伪元素在查看元素时并看不到请问为什么 哪里写错了
问题解答
回答1:如果你的 img 中的 src 是一个无效的地址,那么你的 ::after 或者 ::before 或许还可以在个别浏览器中看到,但是,如果 src 是一个正确的有效的地址,那么这个时候是没有伪元素的。
单标签元素是不存在伪元素的。
回答2:img没有伪元素
相关文章:
1. 正在使用electron和node.js做桌面应用,需要实时监听是否有网络连接,node或者electron是否可以做到2. dockerfile - 我用docker build的时候出现下边问题 麻烦帮我看一下3. android glide asbitmap 在baseadpter中的问题4. node.js - express框架,设置浏览器从缓存中读取静态文件,只有js从缓存中读取了,css还有一些图片为何没有从缓存中读取?5. python 计算两个时间相差的分钟数,超过一天时计算不对6. 做Redis集群的时候,可不可以将Master实例和Slave实例放在一个主机当中?7. python - flask post提交timestamp不能作为参数,这是为什么?8. jquery - js向两边展开9. node.js - nodejs+express+vue10. java - Spring boot 读取 放在 jar 包外的,log4j 配置文件,系统有创建日志文件,不写入日志信息。

网公网安备