Div centreren

Status
Niet open voor verdere reacties.

pasmaskas

Gebruiker
Lid geworden
2 sep 2011
Berichten
75
Beste Helpmij leden,

Ik zou graag willen weten hoe ik deze pagina kan centreren. IK heb al veel dingen geprobeert die ik via google heb gevonden op "div centreren" maar niks werkt.

hier de code:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Untitled-1</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

<style type="text/css">


#Table_01 {
position:absolute;
left:0px;
top:0px;
width:900px;
height:768px;
}

#index-01_ {
position:absolute;
left:0px;
top:0px;
width:900px;
height:21px;
}

#index-02_ {
position:absolute;
left:0px;
top:21px;
width:900px;
height:149px;
}

#index-03_ {
position:absolute;
left:0px;
top:170px;
width:31px;
height:582px;
}

#index-04_ {
position:absolute;
left:31px;
top:170px;
width:160px;
height:24px;
}

#index-05_ {
position:absolute;
left:191px;
top:170px;
width:531px;
height:582px;
}

#index-06_ {
position:absolute;
left:722px;
top:170px;
width:178px;
height:20px;
}

#index-07_ {
position:absolute;
left:722px;
top:190px;
width:178px;
height:501px;
}

#index-08_ {
position:absolute;
left:31px;
top:194px;
width:160px;
height:25px;
}

#index-09_ {
position:absolute;
left:31px;
top:219px;
width:160px;
height:23px;
}

#index-10_ {
position:absolute;
left:31px;
top:242px;
width:160px;
height:24px;
}

#index-11_ {
position:absolute;
left:31px;
top:266px;
width:160px;
height:24px;
}

#index-12_ {
position:absolute;
left:31px;
top:290px;
width:160px;
height:210px;
}

#index-13_ {
position:absolute;
left:31px;
top:500px;
width:160px;
height:252px;
}

#index-14_ {
position:absolute;
left:722px;
top:691px;
width:178px;
height:61px;
}

#index-15_ {
position:absolute;
left:0px;
top:752px;
width:900px;
height:16px;
}

-->
</style>

</head>
<body style="background-color:#FFFFFF;">
<div id="Table_01">
<div id="index-01_">
<img id="index_01" src="images/index_01.png" width="900" height="21" alt="" />
</div>
<div id="index-02_">
<img id="index_02" src="images/index_02.png" width="900" height="149" alt="" />
</div>
<div id="index-03_">
<img id="index_03" src="images/index_03.png" width="31" height="582" alt="" />
</div>
<div id="index-04_">
<img id="index_04" src="images/index_04.png" width="160" height="24" alt="" />
</div>
<div id="index-05_">
<img id="index_05" src="images/index_05.png" width="531" height="582" alt="" />
</div>
<div id="index-06_">
<img id="index_06" src="images/index_06.png" width="178" height="20" alt="" />
</div>
<div id="index-07_">
<img id="index_07" src="images/index_07.png" width="178" height="501" alt="" />
</div>
<div id="index-08_">
<img id="index_08" src="images/index_08.png" width="160" height="25" alt="" />
</div>
<div id="index-09_">
<img id="index_09" src="images/index_09.png" width="160" height="23" alt="" />
</div>
<div id="index-10_">
<img id="index_10" src="images/index_10.png" width="160" height="24" alt="" />
</div>
<div id="index-11_">
<img id="index_11" src="images/index_11.png" width="160" height="24" alt="" />
</div>
<div id="index-12_">
<img id="index_12" src="images/index_12.png" width="160" height="210" alt="" />
</div>
<div id="index-13_">
<img id="index_13" src="images/index_13.png" width="160" height="252" alt="" />
</div>
<div id="index-14_">
<img id="index_14" src="images/index_14.png" width="178" height="61" alt="" />
</div>
<div id="index-15_">
<img id="index_15" src="images/index_15.png" width="900" height="16" alt="" />
</div>
</div>
</body>
</html>


Alvast bedankt

Gr Pascal
 
Hoi,

Dit zou gewoon moeten werken:

HTML:
<div align="center">

mr32 :cool:
 
Dankje voor je reactie. heelaas werk het niet ik wil <div id="Table_01"> centreren daar zit alles in als ik er <div id="Table_01" align="center"> van maak gebeurt er niks
 
Dan moet je de absolute waardes in je css gedeelte eruit gooien, die verhinderen waarschijnlijk dat het divje gecentreerd wordt.
 
neeh je moet alle divs in een 'container' zetten, dit is een groote div die eigelijk de pagina voorsteld, deze geef je de groote: width:960px; en een hoogte die past. belangrijk voor centreren: position:relative; en margin:10px auto; die moeten alleen in de container uiteraart.

EDIT: ik zie dat je table1 als container gebruikt deze is ook prima, maak er dus position:relative; van en margin: 10px auto;
 
Laatst bewerkt:
Je kan de hele <div id="Table_01"> ook weglaten, en dan voor de <body> in de css opnemen:
Code:
body {
   position: relative;
   width: 900px;
   margin: 0 auto;
   }
Met vriendelijke groet,
CSShunter
 
maar als je dat doet kun je de pagina zelf geen achtergrond meer geven ...
 
CSShunter:
Je kan de hele <div id="Table_01"> ook weglaten, en dan voor de <body> in de css opnemen: (...)
royb3:
maar als je dat doet kun je de pagina zelf geen achtergrond meer geven ...
Ja hoor, dat kan evengoed.
Op twee manieren zelfs: door ofwel de <html>, ofwel de <body> de gewenste background te geven.
Kijk maar naar deze serie:
Met vriendelijke groet,
CSShunter
 
Laatst bewerkt:
Status
Niet open voor verdere reacties.
Terug
Bovenaan Onderaan