I'm having trouble with a background gradient not working properly after I centered the page both horizontally and vertically. Here is the code snippet:
body {
background: linear-gradient(to right, #CB356B 0%, #BD3F32 100%);
margin: 0;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
<h1>Lorem Ipsum</h1>
I've also tried another solution, but it's still not working unless I add margin to the body, which is something I don't want to do.
Any help would be appreciated. Thanks!