Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

All comments

  • Fred Campo• 330

    @fredcamp

    Posted

    Hi.. Good day!

    Since you can't add an ::after pseudo element selector to an image inside an <img> tag. You can use a work-around by using another tags like <div> or <span> and declare the background attributes and styles in the CSS.

    <main>
      <section class="card">
        <div class="card__img"></div>
      </section>
    </main>
    

    To apply the purple filter on the image. you can use background-blend-mode: overlay;

    .card {
      &__img {
        background: $primary-color url(../images/image-header-mobile.jpg)
          no-repeat center center/cover;
        background-blend-mode: overlay;
      }
    }
    
    1