Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Two Different Colors With Linear-Gradient Effect

Tags:

css

I am having two colors with me, red and yellow. According to Linear-gradient Format, if we insert red and yellow, automatically smooth transition occurs between them. If i dont want smooth transition, how can we represent them in code? Below code is with smooth transition, but i dont want smooth transition between those two colors. Any Help Please

<!DOCTYPE html>
<html>
<head>
<style>
#grad1 {
    height: 200px;
    background: linear-gradient(red, yellow);
}
</style>
</head>
<body>

<div id="grad1"></div>

</body>
</html>
like image 472
Manoj Karthik Avatar asked Sep 19 '25 10:09

Manoj Karthik


1 Answers

you can

.tg {
  height: 75px;
  width: 400px;
  background-image: linear-gradient(135deg, red 60%, yellow 60.5%);
}

 <div class='tg'></div>

demo

enter image description here

like image 105
User_3535 Avatar answered Sep 21 '25 01:09

User_3535