In html how can our webpage contain two different background colours. For example, blue at top half and red at remaining | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
0

In html how can our webpage contain two different background colours. For example, blue at top half and red at remaining

18th Sep 2017, 4:21 PM
Siddhant Poddar
2 Respostas
+ 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! ā˜ā˜
18th Sep 2017, 4:30 PM
I Am RG
I Am RG - avatar
+ 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
19th Sep 2017, 12:58 AM
CalviÕ²
CalviÕ² - avatar