Dégradé CSS

Fermé
MaxBMX17 Messages postés 68 Date d'inscription vendredi 23 novembre 2018 Statut Membre Dernière intervention 20 octobre 2021 - 9 avril 2019 à 14:37
MaxBMX17 Messages postés 68 Date d'inscription vendredi 23 novembre 2018 Statut Membre Dernière intervention 20 octobre 2021 - 10 avril 2019 à 19:03
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

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
MaxBMX17 Messages postés 68 Date d'inscription vendredi 23 novembre 2018 Statut Membre Dernière intervention 20 octobre 2021 1
10 avril 2019 à 19:03
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