How do I make a shadow per the image below? I don't have any idea how to do that.
Asked
Active
Viewed 71 times
-1

Super Jade
- 5,609
- 7
- 39
- 61

Khujand Nanocoding
- 125
- 1
- 7
-
3Have you tried anything? Do you have any CSS code? – Kalimah Nov 11 '19 at 07:18
-
nope, now i'm working on that. – Khujand Nanocoding Nov 11 '19 at 07:26
-
So when you have some code to show us please update your question – Sfili_81 Nov 11 '19 at 07:47
1 Answers
1
One way you can do it is by styling the pesedo elements ::before
and ::after
like this:
div {
width: 300px;
height: 400px;
background: #FFF;
margin: 40px auto;
position: relative;
}
div::before,
div::after {
z-index: -1;
position: absolute;
content: "";
width: 50%;
height: 50%;
right: 10px;
top: 10px;
max-width: 300px;
background: #777;
box-shadow: 15px 0px 10px #777;
transform: rotate(3deg);
}
div::after {
transform: rotate(-3deg);
top: calc(50% - 10px);
}
<div></div>
This see pen for more shadow styling.

Kalimah
- 11,217
- 11
- 43
- 80
-
thanks, now its more look alike. Also how bout curved block? – Khujand Nanocoding Nov 11 '19 at 10:10
-
One way to do a curve block (or give the illusion of one) is to create a large radial background-gradient and position it accordingly. Also, if you place the shadow element over another element it might give that effect. – Kalimah Nov 11 '19 at 10:18
-
-
I think this merits to open a new question. I also recommend reading more about radial gradients here: https://developer.mozilla.org/en-US/docs/Web/CSS/radial-gradient – Kalimah Nov 11 '19 at 11:29