How do you keep 2 different background effects that need 2 different pixel sizes?

I’m trying to make a gradient from the top-right to the bottom-left and add a grid of dots, however the method i’m using to make the grid of dots is a radial gradient which requires a small background size. This doesnt allow for the gradient.Grid of dots, with a grid of gradients?

I’m not sure what to try here or what to look up.

index.html

<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Montserrat">
        <title>Ameglass</title>
        <link rel="stylesheet" href="style.css">
    </head>
    <body>
        <div class="container">
            <p>Press Any Key to Continue</p>
            <h1 class="gradient-text" style="font-size:400%">Welcome to Ameglass</h1>
        </div>
    </body>
</html>

style.css

/*
body {
    background-image: linear-gradient(to bottom left, #EE82EE 30%, #00D1FF 100%);
    height: 100vh;
    font-family: Montserrat;
}
*/
body {
    background-size: 40px 40px;
    background-image: radial-gradient(circle, #000000 1px, rgba(0, 0, 0, 0) 1px), linear-gradient(to bottom left, #EE82EE 30%, #00D1FF 100%);
}
.container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0px;
}

.gradient-text {
    background-image: linear-gradient(to right, #d173d1 33%,#9460e7 66%, #00D1FF 100%);
    color: transparent;
    -webkit-background-clip: text;
    background-clip: text;
}

h1, p {margin: 0;}

Figured it out, simply add 200vh after the background size.

background-size: 40px 40px, 200vh;

Leave a Comment