Avatar billede mini-me Nybegynder
21. april 2005 - 10:55 Der er 2 kommentarer og
1 løsning

Centrering af CSS setup

Hej i forlængelse af mit tidl. spm http://www.eksperten.dk/spm/611651, har jeg nu sat min side op i en gang layers ved hjælp af dreamweaver MX, men jeg ønsker at få hele sitet centreret hvordan gør jeg det?

Her er hele min kode...

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
  <head>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  <title>Untitled Document</title>
 
  <body>
    <div id="Layer1" style="position:absolute; width:565px; height:165px; z-index:1; background-color: #FFFF00; layer-background-color: #FFFF00; border: 0px none #000000; left: 0px; top: 0px;"></div>
    <div id="Layer2" style="position:absolute; width:187px; height:187px; z-index:2; left: 567px; top: 0; background-color: #FF0000; layer-background-color: #FF0000; border: 0px none #000000;"></div>
    <div id="Layer3" style="position:absolute; width:565px; height:20px; z-index:3; left: 0px; top: 167px; background-color: #99CC00; layer-background-color: #99CC00; border: 0px none #000000;"></div>
    <div id="Layer4" style="position:absolute; width:187px; height:187px; z-index:4; top: 189px; background-color: #CCCCCC; layer-background-color: #CCCCCC; border: 0px none #000000; left: 0px;"></div>
    <div id="Layer5" style="position:absolute; width:187px; height:187px; z-index:5; left: 567px; top: 378px; background-color: #CCCC00; layer-background-color: #CCCC00; border: 0px none #000000;"></div>
    <div id="Layer6" style="position:absolute; width:187px; height:187px; z-index:6; left: 567px; top: 189px; background-color: #3333FF; layer-background-color: #3333FF; border: 0px none #000000;"></div>
  <div id="Layer7" style="position:absolute; width:376px; height:187px; z-index:7; left: 189px; top: 189px; background-color: #FFCCFF; layer-background-color: #FFCCFF; border: 0px none #000000;">asd asd as </div>
  s
  <div id="Layer8" style="position:absolute; width:187px; height:10px; z-index:8; top: 378px; left: 0; background-color: #FFFF33; layer-background-color: #FFFF33; border: 0px none #000000;"></div>
  <div id="Layer9" style="position:absolute; width:187px; height:10px; z-index:9; left: 189px; top: 378px; background-color: #33CCFF; layer-background-color: #33CCFF; border: 0px none #000000;"></div>
  <div id="Layer10" style="position:absolute; width:187px; height:10px; z-index:10; left: 378px; top: 378px; background-color: #66FFCC; layer-background-color: #66FFCC; border: 0px none #000000;"></div>
  <div id="Layer11" style="position:absolute; width:187px; height:177px; z-index:11; left: 0; top: 388px; background-color:#333333;"></div>
  <div id="Layer12" style="position:absolute; width:187px; height:177px; z-index:11; left: 189px; top: 388px; background-color:#000000;"></div>
  <div id="Layer13" style="position:absolute; width:187px; height:177px; z-index:11; left: 378px; top: 388px; background-color:#003399;"></div>
  </body>
</html>
Avatar billede Slettet bruger
21. april 2005 - 10:59 #1
Prøv sådan her:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
  <head>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  <title>Untitled Document</title>

  <body style="text-align: center;">
   
    <div style="position: relative; margin: auto; width: 800px; text-align: left;">
 
    <div id="Layer1" style="position:absolute; width:565px; height:165px; z-index:1; background-color: #FFFF00; layer-background-color: #FFFF00; border: 0px none #000000; left: 0px; top: 0px;"></div>
    <div id="Layer2" style="position:absolute; width:187px; height:187px; z-index:2; left: 567px; top: 0; background-color: #FF0000; layer-background-color: #FF0000; border: 0px none #000000;"></div>
    <div id="Layer3" style="position:absolute; width:565px; height:20px; z-index:3; left: 0px; top: 167px; background-color: #99CC00; layer-background-color: #99CC00; border: 0px none #000000;"></div>
    <div id="Layer4" style="position:absolute; width:187px; height:187px; z-index:4; top: 189px; background-color: #CCCCCC; layer-background-color: #CCCCCC; border: 0px none #000000; left: 0px;"></div>
    <div id="Layer5" style="position:absolute; width:187px; height:187px; z-index:5; left: 567px; top: 378px; background-color: #CCCC00; layer-background-color: #CCCC00; border: 0px none #000000;"></div>
    <div id="Layer6" style="position:absolute; width:187px; height:187px; z-index:6; left: 567px; top: 189px; background-color: #3333FF; layer-background-color: #3333FF; border: 0px none #000000;"></div>
    <div id="Layer7" style="position:absolute; width:376px; height:187px; z-index:7; left: 189px; top: 189px; background-color: #FFCCFF; layer-background-color: #FFCCFF; border: 0px none #000000;">asd asd as </div>
  s
  <div id="Layer8" style="position:absolute; width:187px; height:10px; z-index:8; top: 378px; left: 0; background-color: #FFFF33; layer-background-color: #FFFF33; border: 0px none #000000;"></div>
  <div id="Layer9" style="position:absolute; width:187px; height:10px; z-index:9; left: 189px; top: 378px; background-color: #33CCFF; layer-background-color: #33CCFF; border: 0px none #000000;"></div>
  <div id="Layer10" style="position:absolute; width:187px; height:10px; z-index:10; left: 378px; top: 378px; background-color: #66FFCC; layer-background-color: #66FFCC; border: 0px none #000000;"></div>
  <div id="Layer11" style="position:absolute; width:187px; height:177px; z-index:11; left: 0; top: 388px; background-color:#333333;"></div>
  <div id="Layer12" style="position:absolute; width:187px; height:177px; z-index:11; left: 189px; top: 388px; background-color:#000000;"></div>
  <div id="Layer13" style="position:absolute; width:187px; height:177px; z-index:11; left: 378px; top: 388px; background-color:#003399;"></div>
 
  </div>
 
  </body>
</html>
Avatar billede mini-me Nybegynder
21. april 2005 - 11:02 #2
Cyberman, det er jo rigtigt det virker ;-)

smid et svar...
Avatar billede Slettet bruger
21. april 2005 - 15:39 #3
super :)
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Vi tilbyder markedets bedste kurser inden for webudvikling

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester