D
D
davidbairich2020-11-12 13:34:16
css
davidbairich, 2020-11-12 13:34:16

2 colors in background y?

Hello, is it possible to somehow change the background color not to 50/50, but for example 10% of one color 90% of another?
I tried it with linear-gradient and it turned out to be a gradient in the literal sense.5fad0f8f08915747396048.jpeg

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alex, 2020-11-12
@davidbairich

.loading {
  --percent: 10%;
  background: linear-gradient(90deg, rgba(0,200,0,1) var(--percent), rgba(255,255,255,1) var(--percent)); 
}

S
sinneren, 2020-11-12
@sinneren

background: linear-gradient(90deg, rgba(245,102,0,1) 10%, rgba(160,24,177,1) 10%);

https://cssgradient.io/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question