Site logo

[Resolved] Gradient background

Home Forums Support [Resolved] Gradient background

Home Forums Support Gradient background

Viewing 15 posts - 1 through 15 (of 18 total)
  • Author
    Posts
  • #1516695
    Matthieu

    Hello, do you think that this background is an image or it is possible to recreate the same thing in css ?

    How does he manage to appear a little behind on the page?

    Thanks

    #1516707
    Leo
    Staff
    Customer Support

    Hi there,

    You could try using CSS to apply a gradient to the body background color like this:

    body {
        background: rgb(2,0,36);
        background: linear-gradient(180deg, rgba(2,0,36,1) 0%, rgba(9,9,121,1) 39%, rgba(0,212,255,1) 100%);
    }

    Then just make sure all other elements are transparent in the customizer.

    #1516731
    Matthieu

    Thanks for your rely, but i have the impression that the gradient goes in several directions and not in just one using linear-gradient, no ?

    #1516749
    Leo
    Staff
    Customer Support

    You will need to find the desired gradient – my code is just showing you how to apply a gradient.

    Maybe a site like this would help:
    https://cssgradient.io/

    #1516787
    Matthieu

    Thank you very much for this site. Is there a possibility to have gradients in different orientation for the same background?

    Last little question: How do I make the page appear white for a few seconds at the start and then the gradient background is applied smoothly? As in the example :

    #1516844
    Elvin
    Staff
    Customer Support

    Hi,

    This is a bit tricky but is certainly doable.

    You must remove the current background gradient CSS and replace it with this code:

    body:before{
        content:'';
        height:100%;
        width:100%;
        animation: bgAnimation 2s linear;
        position:absolute;
        top:0;
        left:0;
        background: linear-gradient(292deg, rgba(248,224,223,1) 2%, rgba(255,255,255,0.9094012605042017) 14%, rgba(186,218,232,1) 24%, rgba(61,207,251,1) 41%, rgba(101,129,237,1) 71%, rgba(164,125,244,0.9150035014005602) 99%);
        z-index:-1;
    }
    
    @keyframes bgAnimation {
    0%{ opacity:0; }
    100%{ opacity:1; }
    }
    #1516853
    Matthieu

    The effect works it’s perfect but it takes only part of the page, how could I modify that ?

    Thanks

    #1516856
    Matthieu

    If the gradient can be the same size and go down like here it would be perfect

    #1516870
    Elvin
    Staff
    Customer Support

    The effect works it’s perfect but it takes only part of the page, how could I modify that ?

    Within the code, can you try changing position:absolute; to position:fixed;?

    Let us know how it goes.

    #1516873
    Matthieu

    How do you know all this ? ahah 😅 That’s perfect, thank you very much !

    #1516888
    Elvin
    Staff
    Customer Support

    How do you know all this ? ahah 😅 That’s perfect, thank you very much !

    It comes with CSS experience and knowledge in using Chrome Devtools. 🙂

    No problem. Glad it works for you. 😀

    #1516934
    Matthieu

    Small question that I do not know where to ask. With your knowledge of using Chrome Devtools, how would you optimize my performance metrics in https://web.dev/measure/?

    Thanks 😁

    #1516936
    Matthieu

    – High – Performance – Eliminate render-blocking resources

    How to Eliminate Render Blocking Resources for exemple ?

    – High performance Initial server response time was short

    How to fix this problem too ?

    Thank you so much

    #1516953
    Elvin
    Staff
    Customer Support

    You can refer to Tom’s advice here:
    https://generatepress.com/forums/topic/google-pagespeed-insights-results/#post-1363619

    The link he provided in his reply is quite insightful. It also mentioned about installing AutOptimize plugin that can help you w/ this issue.

    #1516961
    Matthieu

    Great thanks a lot !

Viewing 15 posts - 1 through 15 (of 18 total)
  • The topic ‘Gradient background’ is closed to new replies.