Antworten auf deine Fragen:
Neues Thema erstellen

Antworten zum Thema „DIV zentrieren“

Joernsen

Noch nicht viel geschrieben

Hallo,
ich habe leider ein häufiges Problem. Onkel Google hat mir auch viel ausgespukt und ich habe viele Möglichkeiten ausprobiert, aber bei mir funktioniert das Zentrieren einfach nicht. Kann mir jemand bei meinen Script helfen, da ich schon jede Hoffnung verloren habe. :(
Danke.

<html xmlns="XHTML namespace">
<head>
<title>Spass im Bild</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

<style type="text/css">
<!--
#Tabelle_01 {
position:absolute;
left:0px;
top:0px;
width:995px;
height:596px;
}
#index2-01_ {
position:absolute;
left:0px;
top:0px;
width:995px;
height:16px;
}
#index2-02_ {
position:absolute;
left:0px;
top:16px;
width:15px;
height:580px;
}
#logo_ {
position:absolute;
left:15px;
top:16px;
width:255px;
height:89px;
}
#index2-04_ {
position:absolute;
left:270px;
top:16px;
width:15px;
height:580px;
}
#home-button_ {
position:absolute;
left:285px;
top:16px;
width:120px;
height:89px;
}
#index2-06_ {
position:absolute;
left:405px;
top:16px;
width:15px;
height:104px;
}
#service-but_ {
position:absolute;
left:420px;
top:16px;
width:120px;
height:89px;
}
#index2-08_ {
position:absolute;
left:540px;
top:16px;
width:15px;
height:104px;
}
#kontakt-butt_ {
position:absolute;
left:555px;
top:16px;
width:120px;
height:89px;
}
#index2-10_ {
position:absolute;
left:675px;
top:16px;
width:15px;
height:104px;
}
#gxe4stebuch-butt_ {
position:absolute;
left:690px;
top:16px;
width:120px;
height:89px;
}
#index2-12_ {
position:absolute;
left:810px;
top:16px;
width:185px;
height:89px;
}
#index2-13_ {
position:absolute;
left:15px;
top:105px;
width:255px;
height:16px;
}
#index2-14_ {
position:absolute;
left:285px;
top:105px;
width:120px;
height:15px;
}
#index2-15_ {
position:absolute;
left:420px;
top:105px;
width:120px;
height:15px;
}
#index2-16_ {
position:absolute;
left:555px;
top:105px;
width:120px;
height:15px;
}
#index2-17_ {
position:absolute;
left:690px;
top:105px;
width:305px;
height:15px;
}
#inhalt-index2_ {
position:absolute;
left:285px;
top:120px;
width:525px;
height:476px;
}
#index2-19_ {
position:absolute;
left:810px;
top:120px;
width:1px;
height:476px;
}
#rechts-index2_ {
position:absolute;
left:811px;
top:120px;
width:155px;
height:476px;
}
#index2-21_ {
position:absolute;
left:966px;
top:120px;
width:29px;
height:476px;
}
#index2-22_ {
position:absolute;
left:15px;
top:121px;
width:255px;
height:475px;
}
-->
</style>
</head>

<body style="background-color:#FFFFFF;" >
<div style="text-align: center">
<div style="width: 200px; margin: 0px auto">
Hallo Welt
</div>
</div>

<table width="90%" border="0" text-align="center">
<tr>
<td>
<div id="Tabelle_01">
<div id="index2-01_"> <img id="index2_01" src="Bilder/index2_01.jpg" width="995" height="16" alt="" /> </div>
<div id="index2-02_"> <img id="index2_02" src="Bilder/index2_02.jpg" width="15" height="580" alt="" /> </div>
<div id="logo_"> <a href="index.html"
onmouseover="window.status='HOME'; return true;"
onmouseout="window.status=''; return true;"> <img id="logo" src="Bilder/logo.jpg" width="255" height="89" border="0" alt="HOME" /></a> </div>
<div id="index2-04_"> <img id="index2_04" src="Bilder/index2_04.jpg" width="15" height="580" alt="" /> </div>
<div id="home-button_"> <a href="index2.html"> <img id="home_button" src="Bilder/home_button.jpg" width="120" height="89" border="0" alt="" /></a> </div>
<div id="index2-06_"> <img id="index2_06" src="Bilder/index2_06.jpg" width="15" height="104" alt="" /> </div>
<div id="service-but_"> <a href="service.html"> <img id="service_but" src="Bilder/service_but.jpg" width="120" height="89" border="0" alt="" /></a> </div>
<div id="index2-08_"> <img id="index2_08" src="Bilder/index2_08.jpg" width="15" height="104" alt="" /> </div>
<div id="kontakt-butt_"> <a href="kontakt.html"> <img id="kontakt_butt" src="Bilder/kontakt_butt.jpg" width="120" height="89" border="0" alt="" /></a> </div>
<div id="index2-10_"> <img id="index2_10" src="Bilder/index2_10.jpg" width="15" height="104" alt="" /> </div>
<div id="gxe4stebuch-butt_"> <a href="g&auml;stebuch.html"> <img id="gxe4stebuch_butt" src="Bilder/g&auml;stebuch_butt.jpg" width="120" height="89" border="0" alt="" /></a> </div>
<div id="index2-12_"> <img id="index2_12" src="Bilder/index2_12.jpg" width="185" height="89" alt="" /> </div>
<div id="index2-13_"> <img id="index2_13" src="Bilder/index2_13.jpg" width="255" height="16" alt="" /> </div>
<div id="index2-14_"> <img id="index2_14" src="Bilder/index2_14.jpg" width="120" height="15" alt="" /> </div>
<div id="index2-15_"> <img id="index2_15" src="Bilder/index2_15.jpg" width="120" height="15" alt="" /> </div>
<div id="index2-16_"> <img id="index2_16" src="Bilder/index2_16.jpg" width="120" height="15" alt="" /> </div>
<div id="index2-17_"> <img id="index2_17" src="Bilder/index2_17.jpg" width="305" height="15" alt="" /> </div>
<div id="inhalt-index2_"> <img id="inhalt_index2" src="Bilder/inhalt_index2.jpg" width="525" height="476" alt="" /> </div>
<div id="index2-19_"> <img id="index2_19" src="Bilder/index2_19.jpg" width="1" height="476" alt="" /> </div>
<div id="rechts-index2_"> <img id="rechts_index2" src="Bilder/rechts_index2.jpg" width="155" height="476" alt="" /> </div>
<div id="index2-21_"> <img id="index2_21" src="Bilder/index2_21.jpg" width="29" height="476" alt="" /> </div>
<div id="index2-22_"> <img id="index2_22" src="Bilder/index2_22.jpg" width="255" height="475" alt="" /> </div>
</div>
</td>
</tr>
</table>
</body>
</html>
 

anoX

Nicht mehr ganz neu hier

AW: DIV zentrieren

Davon ab, dass der Code der Hölle gleicht:

Du musst ein Div erstellen und es um dein ganzes Wirrwarr legen. Dazu gib dem body das center mit. Geänderte bzw. fehlende Angaben sind im Code markiert:

Code:
<html xmlns="XHTML namespace">
<head>
<title>Spass im Bild</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

<style type="text/css">
<!--

[COLOR=DarkOrchid]body {
 text-align:center;
}

div#container {
 margin:0 auto;
 position:relative;
 width:955px;
}[/COLOR]

#Tabelle_01 {
position:absolute;
left:0px;
top:0px;
width:995px;
height:596px;
}
#index2-01_ {
position:absolute;
left:0px;
top:0px;
width:995px;
height:16px;
}
#index2-02_ {
position:absolute;
left:0px;
top:16px;
width:15px;
height:580px;
}
#logo_ {
position:absolute;
left:15px;
top:16px;
width:255px;
height:89px;
}
#index2-04_ {
position:absolute;
left:270px;
top:16px;
width:15px;
height:580px;
}
#home-button_ {
position:absolute;
left:285px;
top:16px;
width:120px;
height:89px;
}
#index2-06_ {
position:absolute;
left:405px;
top:16px;
width:15px;
height:104px;
}
#service-but_ {
position:absolute;
left:420px;
top:16px;
width:120px;
height:89px;
}
#index2-08_ {
position:absolute;
left:540px;
top:16px;
width:15px;
height:104px;
}
#kontakt-butt_ {
position:absolute;
left:555px;
top:16px;
width:120px;
height:89px;
}
#index2-10_ {
position:absolute;
left:675px;
top:16px;
width:15px;
height:104px;
}
#gxe4stebuch-butt_ {
position:absolute;
left:690px;
top:16px;
width:120px;
height:89px;
}
#index2-12_ {
position:absolute;
left:810px;
top:16px;
width:185px;
height:89px;
}
#index2-13_ {
position:absolute;
left:15px;
top:105px;
width:255px;
height:16px;
}
#index2-14_ {
position:absolute;
left:285px;
top:105px;
width:120px;
height:15px;
}
#index2-15_ {
position:absolute;
left:420px;
top:105px;
width:120px;
height:15px;
}
#index2-16_ {
position:absolute;
left:555px;
top:105px;
width:120px;
height:15px;
}
#index2-17_ {
position:absolute;
left:690px;
top:105px;
width:305px;
height:15px;
}
#inhalt-index2_ {
position:absolute;
left:285px;
top:120px;
width:525px;
height:476px;
}
#index2-19_ {
position:absolute;
left:810px;
top:120px;
width:1px;
height:476px;
}
#rechts-index2_ {
position:absolute;
left:811px;
top:120px;
width:155px;
height:476px;
}
#index2-21_ {
position:absolute;
left:966px;
top:120px;
width:29px;
height:476px;
}
#index2-22_ {
position:absolute;
left:15px;
top:121px;
width:255px;
height:475px;
}
-->
</style>
</head>

<body style="background-color:#FFFFFF;" >
[COLOR=DarkOrchid]<div id="container">[/COLOR]
<div style="text-align: center">
<div style="width: 200px; margin: 0px auto">
Hallo Welt
</div>
</div>

<table width="90%" border="0" text-align="center">
<tr>
<td>
<div id="Tabelle_01">
<div id="index2-01_"> <img id="index2_01" src="Bilder/index2_01.jpg" width="995" height="16" alt="" /> </div>
<div id="index2-02_"> <img id="index2_02" src="Bilder/index2_02.jpg" width="15" height="580" alt="" /> </div>
<div id="logo_"> <a href="index.html"
onmouseover="window.status='HOME'; return true;"
onmouseout="window.status=''; return true;"> <img id="logo" src="Bilder/logo.jpg" width="255" height="89" border="0" alt="HOME" /></a> </div>
<div id="index2-04_"> <img id="index2_04" src="Bilder/index2_04.jpg" width="15" height="580" alt="" /> </div>
<div id="home-button_"> <a href="index2.html"> <img id="home_button" src="Bilder/home_button.jpg" width="120" height="89" border="0" alt="" /></a> </div>
<div id="index2-06_"> <img id="index2_06" src="Bilder/index2_06.jpg" width="15" height="104" alt="" /> </div>
<div id="service-but_"> <a href="service.html"> <img id="service_but" src="Bilder/service_but.jpg" width="120" height="89" border="0" alt="" /></a> </div>
<div id="index2-08_"> <img id="index2_08" src="Bilder/index2_08.jpg" width="15" height="104" alt="" /> </div>
<div id="kontakt-butt_"> <a href="kontakt.html"> <img id="kontakt_butt" src="Bilder/kontakt_butt.jpg" width="120" height="89" border="0" alt="" /></a> </div>
<div id="index2-10_"> <img id="index2_10" src="Bilder/index2_10.jpg" width="15" height="104" alt="" /> </div>
<div id="gxe4stebuch-butt_"> <a href="g&auml;stebuch.html"> <img id="gxe4stebuch_butt" src="Bilder/g&auml;stebuch_butt.jpg" width="120" height="89" border="0" alt="" /></a> </div>
<div id="index2-12_"> <img id="index2_12" src="Bilder/index2_12.jpg" width="185" height="89" alt="" /> </div>
<div id="index2-13_"> <img id="index2_13" src="Bilder/index2_13.jpg" width="255" height="16" alt="" /> </div>
<div id="index2-14_"> <img id="index2_14" src="Bilder/index2_14.jpg" width="120" height="15" alt="" /> </div>
<div id="index2-15_"> <img id="index2_15" src="Bilder/index2_15.jpg" width="120" height="15" alt="" /> </div>
<div id="index2-16_"> <img id="index2_16" src="Bilder/index2_16.jpg" width="120" height="15" alt="" /> </div>
<div id="index2-17_"> <img id="index2_17" src="Bilder/index2_17.jpg" width="305" height="15" alt="" /> </div>
<div id="inhalt-index2_"> <img id="inhalt_index2" src="Bilder/inhalt_index2.jpg" width="525" height="476" alt="" /> </div>
<div id="index2-19_"> <img id="index2_19" src="Bilder/index2_19.jpg" width="1" height="476" alt="" /> </div>
<div id="rechts-index2_"> <img id="rechts_index2" src="Bilder/rechts_index2.jpg" width="155" height="476" alt="" /> </div>
<div id="index2-21_"> <img id="index2_21" src="Bilder/index2_21.jpg" width="29" height="476" alt="" /> </div>
<div id="index2-22_"> <img id="index2_22" src="Bilder/index2_22.jpg" width="255" height="475" alt="" /> </div>
</div>
</td>
</tr>
</table>
[COLOR=DarkOrchid]</div>[/COLOR]
</body>
</html>
 

Joernsen

Noch nicht viel geschrieben

AW: DIV zentrieren

Ihr seit Spitze. Danke für die schnelle Antworten, so schnell hätte ich nicht gerechnet. Und ich habe gestern den halben Tag dafür verschwendet, das richtige zu finden und hier hat es nur paar Minuten gedauert.
Ja, ich weiß das der Code ziemlich heftig ist. Photoshop hat diesen selbst generiert. Nochmals danke.
 
Bilder bitte hier hochladen und danach über das Bild-Icon (Direktlink vorher kopieren) platzieren.
Antworten auf deine Fragen:
Neues Thema erstellen

Willkommen auf PSD-Tutorials.de

In unseren Foren vernetzt du dich mit anderen Personen, um dich rund um die Themen Fotografie, Grafik, Gestaltung, Bildbearbeitung und 3D auszutauschen. Außerdem schalten wir für dich regelmäßig kostenlose Inhalte frei. Liebe Grüße senden dir die PSD-Gründer Stefan und Matthias Petri aus Waren an der Müritz. Hier erfährst du mehr über uns.

Stefan und Matthias Petri von PSD-Tutorials.de

Nächster neuer Gratisinhalt

03
Stunden
:
:
25
Minuten
:
:
19
Sekunden

Neueste Themen & Antworten

Flatrate für Tutorials, Assets, Vorlagen

Zurzeit aktive Besucher

Statistik des Forums

Themen
175.158
Beiträge
2.581.869
Mitglieder
67.224
Neuestes Mitglied
Aliyah79
Oben