0

box-shadow: 0 0 0 10000px rgba(0,0,0,0.65);

If this box-shadow css applied to DIV, div will be only visible on page, and other thing go under shadow. Is there a possibility, to apply box-shadow that goes 100% or fully to right and bottom only, without going above or top at all?

Vegeta
  • 3
  • 3

3 Answers3

2

Like this:

.box {
 margin:100px auto;
 width:200px;
 height:200px;
 border:2px solid green;
 background:red;
 box-shadow:1000px 1000px 0 1000px #000;
}
<div class="box"></div>

Or like this for the left part:

.box {
 margin:100px auto;
 width:200px;
 height:200px;
 border:2px solid green;
 background:red;
 box-shadow:-1000px 1000px 0 1000px #000;
}
<div class="box"></div>

To make sure you will always cover the whole screen better consider vh vw unit. Since we cannot have the max between 100vh or 100vw simply use 100vh + 100vw

.box {
 margin:100px auto;
 width:200px;
 height:200px;
 border:2px solid green;
 background:red;
 box-shadow:calc(100vh + 100vw) calc(100vh + 100vw) 0 calc(100vh + 100vw) #000;
}
<div class="box"></div>

For the left:

.box {
 margin:100px auto;
 width:200px;
 height:200px;
 border:2px solid green;
 background:red;
 box-shadow:calc(-1 * (100vh + 100vw)) calc(100vh + 100vw) 0 calc(100vh + 100vw) #000;
}
<div class="box"></div>
Temani Afif
  • 245,468
  • 26
  • 309
  • 415
0

div {
  width: 100px;
  height: 100px;
  background-color: yellow;
  box-shadow: 100px 100px 0 100px rgba(0,0,0,1);
  }
<p> lorem lorem lorem lorem lorem lorem lorem lorem lorem lorem lorem lorem lorem lorem lorem lorem lorem lorem lorem lorem lorem lorem lorem lorem lorem lorem lorem lorem lorem lorem lorem lorem lorem lorem lorem lorem lorem lorem lorem lorem lorem lorem lorem lorem lorem lorem lorem lorem lorem lorem lorem lorem lorem lorem lorem lorem lorem lorem lorem lorem lorem lorem lorem lorem lorem lorem lorem lorem lorem lorem lorem lorem lorem lorem lorem lorem lorem lorem lorem lorem lorem lorem lorem lorem lorem lorem lorem lorem lorem lorem 
</p>
<div></div>
ashish singh
  • 6,526
  • 2
  • 15
  • 35
-1

Style it as you prefer from here and after copy it ;)

https://www.cssmatic.com/box-shadow

or

https://css3gen.com/box-shadow/

Luca Spezzano
  • 371
  • 2
  • 14