Background et <DIV> Probleme...

Résolu
Bonjour,

J'ai un gros soucis, quand je créer une div et que je lui donne un background celui ci ce base sur la page entière et pas sur le div en lui même.

Voici mon code:

HTML:

<html>
	<head>
		<title>South's Home</title>
		<link media="screen" rel="stylesheet" type="text/css" href="CSS/index.css" />
		<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />
		<meta http-equiv="content-language" content="fr-FR" />
	</head>
	<body>
		
		<div id="page">
			<div class="top">
			</div>
			<div class="menu_1">
			</div>
			<div class="menu_2">
			</div>
		</div>
	

	</body>
</html>


CSS

*{margin:0;padding:0;}
body
	{
	background-image: url(../images/bg.jpg);
	background-attachment: fixed;
	background-repeat: no-repeat;
	background-size: cover;
	-moz-background-size: cover;
	background-position: center top;
	}
#page
	{
	border: 1px black solid;
	width: 820px;
	height: 600px;
	margin: auto;
	}
.top 
	{
	background-image: url(../images/top_top.png);
	background-attachment: fixed;
	background-position: top left;
	background-repeat: no-repeat;
	width: 400px;
	height: 110px;
	border: 1px black solid;
	margin-left: 200px;
	}
.menu_1
	{
	background-image: url(../images/top1.png);
	background-attachment: fixed;
	background-repeat: no-repeat;
	background-position: 103 124;
	width: 401px;
	height: 372px;
	margin-top: 10px;
	border: 1px black solid;
	float:left
	}
.menu_2
	{
	width: 401px;
	height: 372px;
	margin-top: 10px;
	border: 1px black solid;
	float:right
	}


Comme vous pouvez le constater j'ai du définir une position, mais celle-ci ce base sur la totalité de la page.

Merci a vous

4 réponses

  1. Bonjour,

    Essais sans les règles background-attachment: fixed;
    Ça devrai mieux marcher ^^
    0
    1. Bonjours, merci de m'aider, mais ceci ne change rien du tout :/
      0
      1. Il ne faut pas mettre de "background-attachment: fixed et background-position.
        Pour placer ton div, utilises margin-top , margin-left, margin-right, margin-bottom, si besoin.
        0
        1. Quelqu'un m'a aidé j'ai résolut le probleme, merci :)
          0