0

I did linear 115deg for doing 2 colors, but for the rest, I can't make them be nested gradient from top to bottom, here is my result gradient linear-gradient-i-did, the colors are : white and #F5F5F5 ( grey )

I want the grey that has linear also from bottom to top to be white

is that possible?

the result might like this linear-gradient-expected

i did my own linear like the expected but with rgba to opacity it, using like this

  background: linear-gradient(115deg, #ffffff 68vw, rgba(245, 245, 245, 0.5) 30vw);

i did this gradient for background color so i can put content inside the div here is what i did => https://codepen.io/lpllplp222/pen/vYWPdBe

1 Answer 1

0

You can use clip-path to cut out the part of the gradient you want to be visible.

body {
  background: black;
}

#do-linear {
  width: 100%;
  height: 300px;
  background: linear-gradient(15deg, rgba(255, 255, 255, 1), rgba(255, 255, 255, 0.25));
  clip-path: polygon(50% 100%, 70% 0%, 100% 0%, 100% 100%);
}
<div id="do-linear"></div>

Sign up to request clarification or add additional context in comments.

3 Comments

i am using it for background color, if I use clip-path, the content on that div is also cropped :(
@Pocket add it as pseudo element
is that any example ? @TemaniAfif

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.