• 2019-11-24

    Element overlay

    Comments

    Start a discussion

    To have a nice overlay element you need to add a psuedo element and make the parent element position: relative..

    :after {
      position: absolute;
      width: 100%;
      height: 100%;
      top: 0;
      left: 0;
      box-sizing: border-box;
    
      background: blue;
    }

    Source

    You saw this on CSSPoo first!