How are linear gradients done in general? css

enter image description here

i need gradient like this

i take black and white colors to make a gradient

background: linear-gradient(0deg,rgba(0,0,.3),rgba( 255,255,0));

But where did I get the yellow from?
enter image description here

.line {
background: linear-gradient(0deg,rgba(0,0,.3),rgba( 255,255,0));
color:white;
height:20px;
text-align: center;
}
<div class = 'line'>Test Gradient</div>

help me please

>Solution :

rgb value 255, 255, 0 is yellow.
You probably wanted to use 255, 255, 255 but made a typo.

It will be fixed if you change background value with this:

linear-gradient(0deg, rgba(0,0,0,.3), rgb(255,255,255))

Edit: You should also update rgba(0,0,.3) with rgba(0,0,0,.3) as
@Ouroborus suggested in the comments.

Leave a Reply