Superposition d'un arrière-plan en utilisant le modèle dans les CSS

J'ai utilisé les suivants fichier css à l'arrière-plan, la bg.jpg avec un repeat-x repeat-y modèle de dots.png.

*{
    margin: 0;
    padding: 0;
}
body {
    margin: 0px;
    padding: 0px;
    color: #666;
    font-family: comfortaa;
    font-size: 13px;
    line-height:1.5em; 
    background-color: #fff;
    width: 100%;
    height: 100%;
    background: url(../images/bg.jpg) no-repeat;
    -webkit-background-size: cover;
    -moz-background-size: cover;
    -o-background-size: cover;
    background-size: cover;
}
#header {
    width: 100%;
    height: 17%;
    background: url(../images/header.png) no-repeat;
    -webkit-background-size: contain;
    -moz-background-size: contain;
    -o-background-size: contain;
    background-size: contain;
}
#dots{  
    width:100%;
    height:100%;
    position:fixed;
    top:0px;
    left:0px;
    background:transparent url(../images/dots.png) repeat-x repeat-y top left;
    opacity:0.6;
}

Ensuite, j'ai écrit le index.php comme ceci:

<html>
<head>
    <title>My test page</title>
    <link rel="shortcut icon" href="favicon.ico">
    <link rel="stylesheet" href="css/style.css" type="text/css" media="screen"/>
</head>
<body>
   <div id="header"></div>
   Under Construction
   <div id="dots"></div>
</body>
</html>

Mais le motif n'est pas la superposition. Que puis-je faire pour résoudre ce problème? S'il vous plaît aider.

  • Vous allez nous aider si vous préparez un jsfiddle.net pour nous. Et quelqu'un m'a récemment parlé d'placekitten pour la démo de milieux 🙂
  • Merci pour le vote, je me demandais si cela a fonctionné ou pas.
InformationsquelleAutor Harikrishnan | 2012-06-17