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;}
是想通過這樣的方式設(shè)置兩個方向的動畫 疊加起來出現(xiàn)曲線的效果但是現(xiàn)在添加的偽元素在查看元素時并看不到請問為什么 哪里寫錯了
問題解答
回答1:如果你的 img 中的 src 是一個無效的地址,那么你的 ::after 或者 ::before 或許還可以在個別瀏覽器中看到,但是,如果 src 是一個正確的有效的地址,那么這個時候是沒有偽元素的。
單標(biāo)簽元素是不存在偽元素的。
回答2:img沒有偽元素
相關(guān)文章:
1. python小白 關(guān)于類里面的方法獲取變量失敗的問題2. thinkPHP5中獲取數(shù)據(jù)庫數(shù)據(jù)后默認(rèn)選中下拉框的值,傳遞到后臺消失不見。有圖有代碼,希望有人幫忙3. linux運維 - python遠(yuǎn)程控制windows如何實現(xiàn)4. Python2中code.co_kwonlyargcount的等效寫法5. javascript - 如何用最快的速度C#或Python開發(fā)一個桌面應(yīng)用程序來訪問我的網(wǎng)站?6. django - Python error: [Errno 99] Cannot assign requested address7. mysql數(shù)據(jù)庫做關(guān)聯(lián)一般用id還是用戶名8. [python2]local variable referenced before assignment問題9. 求救一下,用新版的phpstudy,數(shù)據(jù)庫過段時間會消失是什么情況?10. python小白,關(guān)于函數(shù)問題
