0

I tried for hours to make a shape gradient equal to the one at Laracasts. Actually my code don't show anything, can someone help me?

a{
    background: linear-gradient(118deg,#328bf2,#1644ad);
    border-radius: 54% 46% 64% 36%/64% 42% 58% 36%;
    content: "";
    position:absolute;
    top: -250px;
    left: 48%;
    width: 930px;
    height: 870px;
}
<a></a>

5
  • Do you mean the swirl background at the Laracasts site? Commented Jan 11, 2019 at 0:03
  • @AlvaroMontoro Oh they are already using SVG ... Commented Jan 11, 2019 at 0:11
  • @AlvaroMontoro I guess he meant the other shape when the window is reduced as he copied the same CSS code but it's working fine here Commented Jan 11, 2019 at 0:18
  • That shape would be an interesting challenge just with CSS. Probably not possible right now without doing some hacky thing. Commented Jan 11, 2019 at 0:18
  • @AlvaroMontoro with a mix of radial gradient it can be done ;) Commented Jan 11, 2019 at 0:19

2 Answers 2

2

I would consider some SVG for this in order to easily create the curved part of the shape then apply it as a part of a multiple background layer:

.container {
  height: 100vh;
  background: 
  linear-gradient(#fff,#fff) left/calc(100% - 100vh) 100% no-repeat,
  url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" ><path d="M0 64 L64 64 C60 50 56 46 29.33 50.83 C15.33 53.16 10.5 40.33 17.16 27.66 C20 11.66 16.33 6.5 0 0 Z"  fill="white"/></svg>') right/auto 100% no-repeat, 
  linear-gradient(118deg,#328bf2,#1644ad); 
}

body {
 margin:0;
}
<div class="container">

</div>

Here is a good online tool where you can easily adjust the shape:

http://jxnblk.com/paths/?d=M0 64 L64 64 C60 50 56 46 29.33 50.83 C15.33 53.16 10.5 40.33 17.16 27.66 C20 11.66 16.33 6.5 0 0 Z

Simply append the current path to edit it.

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

Comments

0
div
   {
     background-image: linear-gradient(to right bottom, 
     rgba((255, 0, 0, 0.8),.85),
     rgba((255, 0, 0, 0.6), .85)
     );
   }

Specially in here you can specify the angle of the gradient colors by adding - "to right bottom" keyword. also you can use this method in sass.

Comments

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.