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 - sublime快鍵鍵問題2. javascript - immutable配合react提升性能?3. Apache 已經把網站根目錄的改為allow from all了,但是服務器還是不能訪問?4. javascript - 移動端上不能實現拖拽布局嗎?5. 實現bing搜索工具urlAPI提交6. vue.js - Vue 如何像Angular.js watch 一樣監聽數據變化7. javascript - nodejs關于進程間發送句柄的一點疑問8. phpstudy8.1支持win11系統嗎?9. 如何解決Centos下Docker服務啟動無響應,且輸入docker命令無響應?10. css - 寫頁面遇到個布局問題,求大佬們幫解答,在線等,急!~

網公網安備