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. javascript - ueditor引入报错问题2. html5 - 响应式WEB,媒体查询的问题。3. docker-compose中volumes的问题4. docker start -a dockername 老是卡住,什么情况?5. angular.js - angular内容过长展开收起效果6. dockerfile - [docker build image失败- npm install]7. boot2docker无法启动8. docker容器呢SSH为什么连不通呢?9. 关docker hub上有些镜像的tag被标记““This image has vulnerabilities””10. nignx - docker内nginx 80端口被占用

网公网安备