search

Home  >  Q&A  >  body text

html5 - Pseudo-element added but cannot be seen when viewing the element

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

I want to set the animation in two directions in this way, and the effect of the curve will appear when superimposed.
But the pseudo element added now cannot be seen when viewing the element. May I ask why
Where is the mistake?

为情所困为情所困2733 days ago2026

reply all(2)I'll reply

  • 学习ing

    学习ing2017-07-04 13:47:09

    If the src in your img is an invalid address, then your ::after or ::before may still be visible in individual browsers, but if src is A correct and valid address, then there is no pseudo element at this time.

    There are no pseudo-elements in single-label elements.

    reply
    0
  • 女神的闺蜜爱上我

    女神的闺蜜爱上我2017-07-04 13:47:09

    img has no pseudo elements

    reply
    0
  • Cancelreply