Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How can I create this background using a gradient instead of an image?

the current code is below

.wrap {
  display: flex;
  gap: 30px;
}
.item {
  flex-basis: 382px;
  background-image: url(https://i.ibb.co/Jn6J3qN/card.png);
  background-repeat: no-repeat;
  background-size: сontain;
  flex-basis: 382px;
  min-height: 218px;
  border-radius: 20px;
  box-shadow: 0px 4px 20px 0px rgba(0, 0, 0, 0.25);
  padding: 32px;
}
<div class="wrap">
  <div class="item"></div>
  <div class="item"></div>
</div>

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Just set .item background linear-gradient and also set parameters for it.
You can use this colour picker tools, like this website: https://cssgradient.io/, to set linear-gradient parameters.

.wrap {
  display: flex;
  gap: 30px;
}
.item {
  flex-basis: 382px;
  background: rgb(12,28,87);
  background: linear-gradient(156deg, rgba(12,28,87,1) 0%, 
  rgba(83,81,147,1) 100%);
  background-repeat: no-repeat;
  background-size: сontain;
  flex-basis: 382px;
  min-height: 218px;
  border-radius: 20px;
  box-shadow: 0px 4px 20px 0px rgba(0, 0, 0, 0.25);
  padding: 32px;
}
<div class="wrap">
  <div class="item"></div>
  <div class="item"></div>
</div>
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading