How can i put a shadow under the header
like this one?
https://www.000webhost.com/login-cpanel
I know that i can put a box-shadow
but i want a shadow similar to that of 000webhost.
How can i do it?
How can i put a shadow under the header
like this one?
https://www.000webhost.com/login-cpanel
I know that i can put a box-shadow
but i want a shadow similar to that of 000webhost.
How can i do it?
2
Answers
If you inspect the page you’ll see the shadow belong to
:after
selector of CSS. Look on thebackground
property you see it inserts image as background.So, that shadow is created by image. No special CSS skills required in here.
It’s an image positioned off the bottom edge of DIV.holder
It might be possible to mimic that effect with layered
box-shadows
instead of images but it would be ugly and unwieldy code.The only relatively elegant way to do it without using a separate image is to create a small SVG shadow and then embed that SVG code directly into your CSS background. Tools like https://yoksel.github.io/url-encoder/ make this fairly easy.
Here’s a quick codepen showing it in action. https://codepen.io/alexmwalker/pen/ZMVNbo
The SVG lacks some of the visual subtlety of the original PNG, but it scales better and removes the need for an extra asset from the process. Plus you can change the shadow color with a text editor.