您的位置:首頁技術文章
文章詳情頁

html5 - 添加了偽元素 但是查看元素看不到

瀏覽:73日期:2023-06-14 16:01:51

問題描述

.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;}

html5 - 添加了偽元素 但是查看元素看不到

html5 - 添加了偽元素 但是查看元素看不到

是想通過這樣的方式設置兩個方向的動畫 疊加起來出現曲線的效果但是現在添加的偽元素在查看元素時并看不到請問為什么 哪里寫錯了

問題解答

回答1:

如果你的 img 中的 src 是一個無效的地址,那么你的 ::after 或者 ::before 或許還可以在個別瀏覽器中看到,但是,如果 src 是一個正確的有效的地址,那么這個時候是沒有偽元素的。

單標簽元素是不存在偽元素的。

回答2:

img沒有偽元素

標簽: Html5
相關文章:
国产综合久久一区二区三区