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. docker內創建jenkins訪問另一個容器下的服務器問題2. 如何解決Centos下Docker服務啟動無響應,且輸入docker命令無響應?3. 我在centos容器里安裝docker,也就是在容器里安裝容器,報錯了?4. css3 - 學習css構建圖形時,遇到一個很有意思的現象,具體代碼如下5. 極光推送 - Android app消息推送 百度 極光 個推 信鴿哪個好一些?6. javascript - js閉包作用域7. html5 - 百度echart官網下載的地圖json數據亂碼8. html - css 使用字體的時候,格式有什么特殊要求嗎?9. 微信開放平臺 - android 微信支付后點完成按鈕,后回調打開第三方頁面,屏幕閃動,求解決方法10. javascript - echart+百度地圖
