0
In html how can our webpage contain two different background colours. For example, blue at top half and red at remaining
2 Answers
+ 3
https://code.sololearn.com/W8eJyF4MPN7g/?ref=app
you can't in html but with css you can. linear-gradient property does it for you! ââ
+ 1
If you want 2 solid background colors, just add below CSS:
body {
margin: 0;
padding: 0;
height: 100vh;
background-image: linear-gradient(to bottom, red, red 50%, blue 50%);
}
https://code.sololearn.com/WZ99xIj5Hxnq/?ref=app