Search code examples
htmlcssbox-shadow

Hard lines/boxes exposed behind extreme box-shadow effect?


How does one eliminate this effect so that it's just a clean box-shadow glow?

enter image description here

https://jsfiddle.net/stu9qjLp/2/

Code:

#test {
    border: 1px solid red;
    border-radius: 1px;
    width: 1px;
    height: 1px;
    box-shadow: 0 0 250px 125px red;
}

Solution

  • A radial gradient perhaps?

    body {
      margin: 0;
      height: 100vh;
      background: #000;
    }
    
    body::before {
      content: '';
      position: absolute;
      height: 100%;
      width: 100%;
      background-image: radial-gradient(ellipse at center top, red, black 50%, black);
    }