need help to implement it

https://codepen.io/etrbbr/pen/VYZNyxM The question is how to make it look like in the picture, where there is a large gray background section in the header, and this section overlaps part of the cards. How can this be done?
df
CodePen
Untitled
...
No description
7 Replies
Jochem
Jochem3w ago
the easiest way is to fake it. You can set a linear gradient on the first element below the header that transitions abruptly somewhere in the gradient from the header background color to the color used by the rest of the page
Jochem
Jochem3w ago
in this case, there's an even easier (though not as responsive) method, because it's just working with the header color. You just set the gradient on the background: https://codepen.io/jochemm/pen/MYgRrPY
Jochem
Jochem3w ago
I wouldn't actually use the second option, cause if the header ever changes size, it could cause issues
Helgi
HelgiOP3w ago
What if I just apply this to the entire body? body { background: linear-gradient(to bottom, rgb(254, 250, 250) 25%, white 10%); height: 100vh; } Of course, I'll need to adjust it with media queries when resizing the screen, but... I don't know, this should work too, right? It even looks better this way.
Jochem
Jochem3w ago
that's what I did in the second link and yeah, using mediaqueries can be a decent solution, it's just not as responsive by default
Helgi
HelgiOP3w ago
thankts for the tips ! appreciate it

Did you find this page helpful?