ERLEDIGT
JA
JA
ANTWORTEN
5
5
ZUGRIFFE
600
600
EMPFEHLEN
-
14.08.07 23:38 #1
- Registriert seit
- Aug 2007
- Beiträge
- 4
Hallo, ich brauche Eure Hilfe,
bastle gerade an meiner ersten Website (Dreamweaver/Entwurfebene). Habe also mit Codierung noch nicht so viel zu tun gehabt.
Und zwar möchte ich, dass die Site in allen Browsern mittig positioniert wird. Ich habe verschiedene Sachen ausprobiert, bin aber nicht weitergekommen.
Den Code habe ich mal reinkopiert, vielleicht kann mir jemand helfen.
Herzlich, Sven
Code :1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457
<!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> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> <title>Praxis_Site</title> <style type="text/css"> <!-- #logo { position:absolute; left:40px; top:73px; width:150px; height:140px; z-index:3; background-image: url(Bilder/Logo.jpg); visibility: visible; } #Layer1 { position:absolute; left:221px; top:20px; width:50px; height:186px; z-index:2; } #balken { position:absolute; left:305px; top:184px; width:555px; height:2px; z-index:5; border-top-width: thin; border-right-width: thin; border-bottom-width: thin; border-left-width: thin; border-top-style: solid; border-right-style: none; border-bottom-style: none; border-left-style: none; border-top-color: #FACE5E; border-right-color: #FACE5E; border-bottom-color: #FACE5E; border-left-color: #FACE5E; visibility: visible; } #text { position:absolute; left:305px; top:240px; width:299px; height:430px; z-index:4; border-top-width: thin; border-right-width: thin; border-bottom-width: thin; border-left-width: thin; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; visibility: visible; background-color: #FACE5E; } #Praxisbezeichnung { position:absolute; left:312px; top:93px; width:548px; height:60px; z-index:6; visibility: visible; } #spruch { position:absolute; left:50px; top:274px; width:245px; height:250px; z-index:7; border-top-width: thin; border-right-width: thin; border-bottom-width: thin; border-left-width: thin; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; visibility: visible; } #foto { position:absolute; left:627px; top:240px; width:223px; height:342px; z-index:8; background-image: url(Bilder/Test_foto.jpg); visibility: visible; } body { background-image: url(); } .Stil4 {font-size: 11px} .Stil5 {font-family: Verdana, Arial, Helvetica, sans-serif} .Stil6 {font-style: italic; font-family: Verdana, Arial, Helvetica, sans-serif;} #Name { position:absolute; left:40px; top:40px; width:820px; height:30px; z-index:9; visibility: visible; border-top-width: thin; border-right-width: thin; border-bottom-width: thin; border-left-width: thin; border-top-style: none; border-right-style: none; border-bottom-style: solid; border-left-style: none; border-top-color: #FACE5E; border-right-color: #FACE5E; border-bottom-color: #FACE5E; border-left-color: #FACE5E; } #Berufsbezeichnung { position:absolute; left:40px; top:70px; width:270px; height:21px; z-index:10; border-top-width: thin; border-right-width: thin; border-bottom-width: thin; border-left-width: thin; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; visibility: visible; } #Layer2 { position:absolute; left:445px; top:27px; width:258px; height:34px; z-index:9; } .Stil11 { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 24px; color: #FACE5E; } #Layer3 { position:absolute; left:747px; top:54px; width:126px; height:22px; z-index:10; } .Stil12 { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; color: #FACE5E; } #Logo_Rahmen { position:absolute; left:40px; top:20px; width:158px; height:145px; z-index:11; border-top-width: thin; border-right-width: thin; border-bottom-width: thin; border-left-width: thin; border-top-style: solid; border-right-style: solid; border-bottom-style: none; border-left-style: solid; border-top-color: #FACE5E; border-right-color: #FACE5E; border-bottom-color: #FACE5E; border-left-color: #FACE5E; visibility: hidden; } .Stil13 {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 18px; color: #999999; } #Steuerungsrahmen { position:absolute; left:305px; top:184px; width:555px; height:29px; z-index:12; border-bottom-width: thin; border-left-width: thin; border-top-style: none; border-right-style: none; border-bottom-style: solid; border-left-style: solid; border-top-color: #FACE5E; border-right-color: #FACE5E; border-bottom-color: #FACE5E; border-left-color: #FACE5E; visibility: visible; } #Steuerungsleiste { position:absolute; left:308px; top:187px; width:552px; height:24px; z-index:13; background-color: #FACE5E; visibility: visible; } #Steuerungselement_1 { position:absolute; left:315px; top:192px; width:135px; height:16px; z-index:14; border-top-width: thin; border-right-width: thin; border-bottom-width: thin; border-left-width: thin; border-top-style: none; border-right-style: solid; border-bottom-style: none; border-left-style: none; border-top-color: #FFFFFF; border-right-color: #FFFFFF; border-bottom-color: #FFFFFF; border-left-color: #FFFFFF; visibility: visible; } #Steuerungselement_2 { position:absolute; left:460px; top:192px; width:49px; height:16px; z-index:15; border-top-width: thin; border-right-width: thin; border-bottom-width: thin; border-left-width: thin; border-top-style: none; border-right-style: solid; border-bottom-style: none; border-left-style: none; border-top-color: #FFFFFF; border-right-color: #FFFFFF; border-bottom-color: #FFFFFF; border-left-color: #FFFFFF; visibility: visible; } #Steuerungselement_3 { position:absolute; left:519px; top:192px; width:133px; height:16px; z-index:16; border-top-width: thin; border-right-width: thin; border-bottom-width: thin; border-left-width: thin; border-top-style: none; border-right-style: solid; border-bottom-style: none; border-left-style: none; border-top-color: #FFFFFF; border-right-color: #FFFFFF; border-bottom-color: #FFFFFF; border-left-color: #FFFFFF; visibility: visible; } #Steuerungselement_4 { position:absolute; left:810px; top:192px; width:49px; height:16px; z-index:17; visibility: visible; } #Rahmen_Site { position:absolute; left:20px; top:20px; width:850px; height:680px; z-index:2; border: thin solid #FACE5E; visibility: hidden; } .Stil16 {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; color: #999999; } #Verbindungslinie_rechts { position:absolute; left:858px; top:70px; width:2px; height:115px; z-index:18; border-top-width: thin; border-right-width: thin; border-bottom-width: thin; border-left-width: thin; border-top-style: none; border-right-style: solid; border-bottom-style: none; border-left-style: none; border-top-color: #FACE5E; border-right-color: #FACE5E; border-bottom-color: #FACE5E; border-left-color: #FACE5E; visibility: visible; } #Seitenlinie_links { position:absolute; left:40px; top:216px; width:2px; height:485px; z-index:19; border-top-width: thin; border-right-width: thin; border-bottom-width: thin; border-left-width: thin; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: solid; border-top-color: #FACE5E; border-right-color: #FACE5E; border-bottom-color: #FACE5E; border-left-color: #FACE5E; visibility: visible; } #Seitenlinie_unten { position:absolute; left:40px; top:699px; width:820px; height:2px; z-index:20; border-top-width: thin; border-right-width: thin; border-bottom-width: thin; border-left-width: thin; border-top-style: none; border-right-style: none; border-bottom-style: solid; border-left-style: none; border-top-color: #FACE5E; border-right-color: #FACE5E; border-bottom-color: #FACE5E; border-left-color: #FACE5E; visibility: visible; } #Seitenlinie_rechts { position:absolute; left:858px; top:213px; width:2px; height:489px; z-index:21; border-top-width: thin; border-right-width: thin; border-bottom-width: thin; border-left-width: thin; border-top-style: none; border-right-style: solid; border-bottom-style: none; border-left-style: none; border-top-color: #FACE5E; border-right-color: #FACE5E; border-bottom-color: #FACE5E; border-left-color: #FACE5E; visibility: visible; } #Balken_unten { position:absolute; left:40px; top:704px; width:820px; height:24px; z-index:22; background-color: #FACE5E; visibility: visible; } #Abstandhalter_unten { position:absolute; left:40px; top:728px; width:820px; height:40px; z-index:23; visibility: visible; } .Stil18 {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; color: #FFFFFF; } --> </style> </head> <body> <div id="logo"></div> <div id="balken"></div> <div id="text"></div> <div id="Praxisbezeichnung"> <p align="center" class="Stil16">Praxis für </p> <p align="center" class="Stil13">Akupunkt-Meridian-Massage und Craniosacrale Osteopathie </p> </div> <div class="Stil4" id="spruch"> <p><em><span class="Stil5">Es ist wichtig, daß du etwas willst</span></em></p> <p> </p> <p><em><span class="Stil5">In der Tiefe deines Wesens, </span></em></p> <p> </p> <p><span class="Stil6">Daß du etwas von ganzem Herzen glaubst, </span></p> <p> </p> <p><span class="Stil6">Daß du wählst, wie du leben willst. </span></p> <p> </p> <p align="right"><span class="Stil5">Ulrich Schaffer </span></p> </div> <div id="foto"></div> <div id="Name"><span class="Stil11">Carola Schmidt </span></div> <div id="Berufsbezeichnung"> <p align="right" class="Stil12">Physiotherapeutin</p> </div> <div id="Steuerungsrahmen"></div> <div id="Steuerungsleiste"></div> <div id="Steuerungselement_1"> <div align="left"><span class="Stil18">Therapiespektrum</span></div> </div> <div id="Steuerungselement_2"> <div align="left"><span class="Stil18">Praxis</span></div> </div> <div id="Steuerungselement_3"><span class="Stil18">Kontakt & Termin</span></div> <div id="Steuerungselement_4"> <div align="center"><span class="Stil18">Vitae</span></div> </div> <div id="Verbindungslinie_rechts"></div> <div id="Seitenlinie_links"></div> <div id="Seitenlinie_unten"></div> <div id="Seitenlinie_rechts"></div> <div id="Balken_unten"></div> <div id="Abstandhalter_unten"></div> </body> </html>
-
15.08.07 06:10 #2Maik Tutorials.de Gastzugang
Hi,
erweiter das Stylesheet folgendermaßen:
und binde das bestehende Layout in das DIV #wrapper ein:Code :1 2 3 4 5 6 7
#wrapper { position:absolute; left:50%; top:20px; width:820px; margin-left:-410px; /* negative Hälfte von width:820px */ }
Anmerkung: Über die Suchfunktion hättest du hier im CSS-Board unzählige Threads entdeckt, die sich schon mal genau mit dieser Frage beschäftigt haben.Code :1 2 3 4 5
<body> [b]<div id="wrapper">[/b] <!-- Hier folgt der Bestand --> [b]</div>[/b] </body>
-
15.08.07 09:43 #3
- Registriert seit
- Aug 2007
- Beiträge
- 4
Hallo,
danke für die schnelle Antwort. Ich habe den Code integriert. Das Problem ist aber, dass die Site jetzt zu rechtslastig positioniert ist. Ich benutze übrigens als Vorschaubrowser Safari und Firefox. Kann man da noch etwas ändern?
-
15.08.07 11:29 #4Maik Tutorials.de Gastzugang
Ausgehend von dem DIV #Abstandhalter_unten (820px breit, Startposition von links 40px) müsste die Box insgesamt 860px breit sein, und der margin-left-Wert entsprechend "-430px" betragen.
Ansonsten müssen die Positionsangaben korrigiert werden, damit die Elemente am linken Elementrand bei null, und nicht bei 40px beginnen.
-
15.08.07 20:10 #5
- Registriert seit
- Aug 2007
- Beiträge
- 4
Hallo,
ich denke, ich weiß an was es lag. Die Breite des Abstandshalters_unten ist 820px. Da ich von vorherein einen Abstand links von 40px eingerichtet habe, muss ich diesen rechts jetzt dazu nehmen. D.h. 820px+ 2*40px= 900px (width).Die negative Breite beträgt somit 450px.
Und siehe da, meine Site ist zentriert.
Ich danke für den Code.
Herzlich, Sven.
-
15.08.07 20:23 #6Maik Tutorials.de Gastzugang
Ähnliche Themen
-
Ebenen zentrieren bei unterschiedlichen Auflösungen
Von gamekeeper im Forum CSSAntworten: 1Letzter Beitrag: 04.11.04, 08:12 -
Ebenen zentrieren
Von hoho im Forum HTML & XHTMLAntworten: 3Letzter Beitrag: 25.06.04, 18:28 -
Ebenen zentrieren
Von eugster im Forum HTML & XHTMLAntworten: 1Letzter Beitrag: 03.05.04, 11:10 -
Ebenen zentrieren
Von JojoS im Forum HTML-EditorenAntworten: 0Letzter Beitrag: 31.10.03, 18:39 -
Ebenen/Animation...zentrieren
Von lisa im Forum HTML-EditorenAntworten: 1Letzter Beitrag: 04.12.01, 20:05






Login





