Bonjour,
Voilà je me retrouve devant un facheux problème, j'ai découpe mon design de façon a pouvoir faire des background-repeat: repeat-x; ou repeat-y;. Mais le seul problème est que j'aimerai centrer mes calques sur ma page (automatiquement).
J'y suis arrivé en faisant un width: 1000px et un margin: auto; dans le body du css, mais j'ai été obligé de mettre mes calques div avec position en relative pour qu'ils soient centrés.
Du coup je me suis mit à décalé tout mes div positionné vers des position y négatives...
Maintenant le résultat est bon, mais ma page reste super longue (comme si les div étaient toujours présent en bas mais qu'il se positionnaient en haut.
Voici le code de ma page html et de mon css, merci d'avance pour votre aide qui me sera précieuse car c'est un problème que je rencontre à chaque fois.
xHTML
CSS
Merci de votre aide.
Modifié par Scriptiz (27 Nov 2007 - 18:36)
Voilà je me retrouve devant un facheux problème, j'ai découpe mon design de façon a pouvoir faire des background-repeat: repeat-x; ou repeat-y;. Mais le seul problème est que j'aimerai centrer mes calques sur ma page (automatiquement).
J'y suis arrivé en faisant un width: 1000px et un margin: auto; dans le body du css, mais j'ai été obligé de mettre mes calques div avec position en relative pour qu'ils soient centrés.
Du coup je me suis mit à décalé tout mes div positionné vers des position y négatives...
Maintenant le résultat est bon, mais ma page reste super longue (comme si les div étaient toujours présent en bas mais qu'il se positionnaient en haut.
Voici le code de ma page html et de mon css, merci d'avance pour votre aide qui me sera précieuse car c'est un problème que je rencontre à chaque fois.
xHTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>image.png</title>
<meta http-equiv="Content-Type" content="text/html;iso-8859-1" />
<link href="style.css" rel="stylesheet" type="text/css" title="image" media="screen" />
</head>
<body>
<div id="image-r1c1"></div>
<div id="image-r1c2"></div>
<div id="image-r1c3"></div>
<div id="image-r1c5"></div>
<div id="image-r1c7"></div>
<div id="image-r1c11"></div>
<div id="image-r1c12"></div>
<div id="image-r1c14"></div>
<div id="image-r2c2"></div>
<div id="image-r2c5"></div>
<div id="image-r2c7"></div>
<div id="image-r2c10"></div>
<div id="image-r2c13"></div>
<div id="image-r2c16"></div>
<div id="image-r3c2"></div>
<div id="image-r3c3"></div>
<div id="image-r3c7"></div>
<div id="image-r3c13"></div>
<div id="image-r4c2"></div>
<div id="image-r4c4"></div>
<div id="image-r4c8"></div>
<div id="image-r4c13"></div>
<div id="image-r5c2"></div>
<div id="image-r5c3"></div>
<div id="image-r5c4"></div>
<div id="image-r5c8"></div>
<div id="image-r5c9"></div>
<div id="image-r5c10"></div>
<div id="image-r5c13"></div>
<div id="image-r5c15"></div>
<div id="image-r6c3"></div>
<div id="image-r6c6"></div>
<div id="image-r6c7"></div>
<div id="image-r6c11"></div>
<div id="image-r6c12"></div>
</body>
</html>
CSS
@charset "utf-8";
/* CSS Document */
body
{
background-color: #F3F3F3;
margin: auto;
width: 1000px;
}
#image-r1c1
{
/*background-image: url("images/image_r1_c1.png");*/
background-color: #F3F3F3;
position: relative;
left: 0px;
top: 0px;
width: 16px;
height: 750px;
z-index: 1;
visibility: visible;
}
#image-r1c2
{
/*background-image: url("images/image_r1_c2.png");*/
background-color: #F3F3F3;
position: relative;
left: 16px;
top: -750px;
width: 29px;
height: 28px;
z-index: 2;
visibility: visible;
}
#image-r1c3
{
background-image: url("images/image_r1_c3.png");
position: relative;
left: 45px;
top: -778px;
width: 25px;
height: 28px;
z-index: 3;
visibility: visible;
}
#image-r1c5
{
background-image: url("images/image_r1_c5.png");
background-repeat: repeat-x;
position: relative;
left: 70px;
top: -806px;
width: 595px;
height: 28px;
z-index: 4;
visibility: visible;
}
#image-r1c7
{
background-image: url("images/image_r1_c7.png");
position: relative;
left: 665px;
top: -834px;
width: 56px;
height: 28px;
z-index: 5;
visibility: visible;
}
#image-r1c11
{
background-image: url("images/image_r1_c11.png");
position: relative;
left: 721px;
top: -862px;
width: 202px;
height: 28px;
z-index: 6;
visibility: visible;
}
#image-r1c12
{
background-image: url("images/image_r1_c12.png");
position: relative;
left: 923px;
top: -890px;
width: 26px;
height: 28px;
z-index: 7;
visibility: visible;
}
#image-r1c14
{
/*background-image: url("images/image_r1_c14.png");*/
background-color: #F3F3F3;
position: relative;
left: 949px;
top: -918px;
width: 51px;
height: 28px;
z-index: 8;
visibility: visible;
}
#image-r2c2
{
background-image: url("images/image_r2_c2.png");
position: relative;
left: 16px;
top: -918px;
width: 54px;
height: 28px;
z-index: 9;
visibility: visible;
}
#image-r2c5
{
background-image: url("images/image_r2_c5.png");
position: relative;
left: 70px;
top: -946px;
width: 595px;
height: 28px;
z-index: 10;
visibility: visible;
}
#image-r2c7
{
background-image: url("images/image_r2_c7.png");
position: relative;
left: 665px;
top: -974px;
width: 47px;
height: 28px;
z-index: 11;
visibility: visible;
}
#image-r2c10
{
background-image: url("images/image_r2_c10.png");
position: relative;
left: 712px;
top: -1002px;
width: 222px;
height: 202px;
z-index: 12;
visibility: visible;
}
#image-r2c13
{
background-image: url("images/image_r2_c13.png");
position: relative;
left: 934px;
top: -1204px;
width: 60px;
height: 28px;
z-index: 13;
visibility: visible;
}
#image-r2c16
{
/*background-image: url("images/image_r2_c16.png");*/
background-color: #F3F3F3;
position: relative;
left: 994px;
top: -1232px;
width: 6px;
height: 722px;
z-index: 14;
visibility: visible;
}
#image-r3c2
{
background-image: url("images/image_r3_c2.png");
position: relative;
left: 16px;
top: -1926px;
width: 29px;
height: 145px;
z-index: 15;
visibility: visible;
}
#image-r3c3
{
background-image: url("images/image_r3_c3.png");
position: relative;
left: 45px;
top: -2071px;
width: 620px;
height: 145px;
z-index: 16;
visibility: visible;
}
#image-r3c7
{
background-image: url("images/image_r3_c7.png");
position: relative;
left: 665px;
top: -2216px;
width: 47px;
height: 145px;
z-index: 17;
visibility: visible;
}
#image-r3c13
{
background-image: url("images/image_r3_c13.png");
position: relative;
left: 934px;
top: -2361px;
width: 60px;
height: 145px;
z-index: 18;
visibility: visible;
}
#image-r4c2
{
background-image: url("images/image_r4_c2.png");
position: relative;
left: 16px;
top: -2361px;
width: 44px;
height: 29px;
z-index: 19;
visibility: visible;
}
#image-r4c4
{
background-image: url("images/image_r4_c4.png");
position: relative;
left: 60px;
top: -2390px;
width: 616px;
height: 29px;
z-index: 20;
visibility: visible;
}
#image-r4c8
{
background-image: url("images/image_r4_c8.png");
position: relative;
left: 676px;
top: -2419px;
width: 36px;
height: 29px;
z-index: 21;
visibility: visible;
}
#image-r4c13
{
background-image: url("images/image_r4_c13.png");
position: relative;
left: 934px;
top: -2448px;
width: 60px;
height: 29px;
z-index: 22;
visibility: visible;
}
#image-r5c2
{
/*background-image: url("images/image_r5_c2.png");*/
background-color: #F3F3F3;
position: relative;
left: 16px;
top: -2448px;
width: 29px;
height: 520px;
z-index: 23;
visibility: visible;
}
#image-r5c3
{
background-image: url("images/image_r5_c3.png");
background-repeat: repeat-y;
position: relative;
left: 45px;
top: -2968px;
width: 15px;
height: 495px;
z-index: 24;
visibility: visible;
}
#image-r5c4
{
/*background-image: url("images/image_r5_c4.png");*/
background-color: #FFFFFF;
position: relative;
left: 60px;
top: -3463px;
width: 616px;
height: 495px;
z-index: 25;
visibility: visible;
}
#image-r5c8
{
background-image: url("images/image_r5_c8.png");
background-repeat: repeat-y;
position: relative;
left: 676px;
top: -3958px;
width: 18px;
height: 495px;
z-index: 26;
visibility: visible;
}
#image-r5c9
{
background-image: url("images/image_r5_c9.png");
position: relative;
left: 694px;
top: -4453px;
width: 18px;
height: 495px;
z-index: 27;
visibility: visible;
}
#image-r5c10
{
background-image: url("images/image_r5_c10.png");
background-color: #FFFFFF;
background-repeat: no-repeat;
position: relative;
left: 712px;
top: -4948px;
width: 222px;
height: 495px;
z-index: 28;
visibility: visible;
}
#image-r5c13
{
background-image: url("images/image_r5_c13.png");
position: relative;
left: 934px;
top: -5443px;
width: 19px;
height: 495px;
z-index: 29;
visibility: visible;
}
#image-r5c15
{
/*background-image: url("images/image_r5_c15.png");*/
background-color: #F3F3F3;
position: relative;
left: 953px;
top: -5938px;
width: 41px;
height: 520px;
z-index: 30;
visibility: visible;
}
#image-r6c3
{
background-image: url("images/image_r6_c3.png");
position: relative;
left: 45px;
top: -5963px;
width: 26px;
height: 25px;
z-index: 31;
visibility: visible;
}
#image-r6c6
{
background-image: url("images/image_r6_c6.png");
background-repeat: repeat-x;
position: relative;
left: 71px;
top: -5988px;
width: 594px;
height: 25px;
z-index: 32;
visibility: visible;
}
#image-r6c7
{
background-image: url("images/image_r6_c7.png");
position: relative;
left: 665px;
top: -6013px;
width: 56px;
height: 25px;
z-index: 33;
visibility: visible;
}
#image-r6c11
{
background-image: url("images/image_r6_c11.png");
background-repeat: repeat-x;
position: relative;
left: 721px;
top: -6038px;
width: 202px;
height: 25px;
z-index: 34;
visibility: visible;
}
#image-r6c12
{
background-image: url("images/image_r6_c12.png");
position: relative;
left: 923px;
top: -6063px;
width: 30px;
height: 25px;
z-index: 35;
visibility: visible;
}
Merci de votre aide.
Modifié par Scriptiz (27 Nov 2007 - 18:36)