0
help!
i just create a square shape using <div> element.. <div id=square><div> #square { width:100px; height:100px; background-color:gold; } my question is, how to make the square has 2 different color? the square will be divided by half, the top of the square will be colored gold and the bottom is red..
8 Réponses
+ 1
direction of gradient, and it's shorter than "to bottom" 😉
0
background: linear-gradient(to top, #f00 0%, #f00 49.9%, #ffd700 50%); put your colors
0
why there is "to top" in the bracket?
0
i removed it ("to top") and nothing is happen, why?
0
because to top is default value
0
btw, how to move the square to bottom? i mean.. i want to move the square to bottom in any value of px (i guess) ..
0
position : fixed;
bottom : 0;
0
thnx 😊