set a background with linear gradient

Hi everyone I get shame to make this request I want set a background my html:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="style.css">
<title>background</title>
</head>
<body>
<div class="top"></div>
<div class="bottom"></div>
<div class="left"></div>
<div class="right"></div>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="style.css">
<title>background</title>
</head>
<body>
<div class="top"></div>
<div class="bottom"></div>
<div class="left"></div>
<div class="right"></div>
</body>
</html>
my css:
*,*::before,*::after{
box-sizing: border-box;
margin: 0;
padding: 0;
}

body{
width: 100vw;
height: 100vh;
background: linear-gradient(40de,rgb(108,0,162), rgb(0,17,82));

}
*,*::before,*::after{
box-sizing: border-box;
margin: 0;
padding: 0;
}

body{
width: 100vw;
height: 100vh;
background: linear-gradient(40de,rgb(108,0,162), rgb(0,17,82));

}
I get this:
6 Replies
Pat66
Pat66OP•16mo ago
I don't understand what is going wrong . Can I get some idea to fix it thanks
Mannix
Mannix•16mo ago
you are missing g in deg 🙂 dev tools are great to spot this sort of things 😉
Pat66
Pat66OP•16mo ago
thanks
Tok124 (CSS Nerd)
Tok124 (CSS Nerd)•16mo ago
this is unrelated to this issue, but why set width:100vw; on body? body will already take full width. also if you add more content so the vertical scrollbar appears, then a horizontal scrollbar will also appear. this could be fixed by using svw instead of vw but still, it doesnt make any sense to use it since it already takes 100% of the width by default
Mannix
Mannix•16mo ago
people for some odd reason like to slap 100vw or 100vh anywhere 😄
Tok124 (CSS Nerd)
Tok124 (CSS Nerd)•16mo ago
Yeah, i have noticed that 😂
Want results from more Discord servers?
Add your server