How can i partially set the background color of a div tag using CSS. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

How can i partially set the background color of a div tag using CSS.

example if height of div element is 300px i want the background to fill up to 150px height.

27th May 2017, 9:03 AM
ankur tank
ankur tank - avatar
2 Answers
+ 1
try this div{ background-color: blue; background-size: 150px 300px; } yes for mix of two colours you have to use linear gradient
27th May 2017, 9:27 AM
Sandeep Chatterjee
0
I don't actually think u can do that but I think u can use gradient like upper half be blue and lower half be the background color
27th May 2017, 9:11 AM
_Retr0/-
_Retr0/- - avatar