Dégradé CSS

Bonjour,

Je voudrais que ça se mette sur toute la page

CSS :

div
{
    background-image: linear-gradient(blue, green);
    width: 400px;
    height: 300px;
}


Là, ça fait un carré en bas à gauche; faut mettre combien à width et height pour que ça remplisse toute la page ?

2 réponses

  1. Hello,

    <!DOCTYPE html>
    <html>
    <head>
     <title></title>
     <style type="text/css">
      html {
       height: 100%;
      }
      body {
       background-image: linear-gradient(blue, green);
      }
     </style>
    </head>
    <body>
     <div></div>
    </body>
    </html>
    
    0
    1. Merci ça marche.

      J'ai ça aussi :

      body{
          background: -webkit-linear-gradient(left, red, orange, blue); 
          background: -o-linear-gradient(right, red, orange, blue);
          background: -moz-linear-gradient(right, red, orange, blue); 
          background: linear-gradient(to right, red, orange, blue); 
      }
      0