29. januar 2004 - 12:54
Der er
6 kommentarer og 1 løsning
Layout med css - fejl
Jeg sidder og bøvler med noget layout i css... jeg har denne css fil: ------------------------------------------------------ body { margin:0px; } #title { position:absolute; left:0px; top:0px; width:100%; height: 75px; background-image: url(../GFX/Background.GIF); background-repeat: repeat; z-index: 2; } #leftmenu { padding-top: 150px; top: -75px; position:absolute; left:0px; width:150px; height:100%; background-image: url(../GFX/Background.GIF); background-repeat: repeat; z-index: 1; } #rightmenu { padding-top: 150px; top: -75px; position:absolute; right:0px; width:150px; height:100%; background-image: url(../GFX/Background.GIF); background-repeat: repeat; z-index: 1; } #content { padding-top: 75px; margin-left:150px; margin-right:150px; background-color: green; height: 100%; z-index: 0; } ------------------------------------------------------ Problemet er at mine menuer (leftmenu rightmenu) er sat til 100%, men menuerne kommer altså til at være 100%+75px... Hvordan laver jeg det så det optimalt? Min content er mærkelig nok perfekt...
Annonceindlæg fra Deloitte
29. januar 2004 - 12:57
#1
Lige en lille rettelse... I mozilla firebird, kommer højden til at være 100%+75px, mens i IE kommer den til at være 100%-75px :(
29. januar 2004 - 13:22
#2
prøv body,html { margin: 0; padding: 0; } #title { position:absolute; left:0px; top:0px; width:100%; height: 75px; background-image: url(../GFX/Background.GIF); background-repeat: repeat; z-index: 2; } #leftmenu { top: 150px; padding: 0 10px 0 10px; /*det bestemmer du selv */ position:absolute; left:0px; width: 150px; /* overvej at gøre det elastisk */ height:100%; background-image: url(../GFX/Background.GIF); background-repeat: repeat; z-index: 1; } #rightmenu { top: 150px; padding: 0 10px 0 10px; /*det bestemmer du selv */ position:absolute; right:0px; background-image: url(../GFX/Background.GIF); background-repeat: repeat; z-index: 1; } #content { padding-top: 150px; margin: 0 150px 0 150px; background-color: green; height: 100%; z-index: 0; }
29. januar 2004 - 13:32
#3
et par fejl... prøv body,html { margin: 0; padding: 0; } #title { position:absolute; left:0px; top:0px; width:100%; height:75px; /*background-image: url(../GFX/Background.GIF);*/ background-color: cyan; /*background-repeat: repeat;*/ z-index: 2; } #leftmenu { top: 75px; padding: 0 10px 0 10px; /*det bestemmer du selv */ position:absolute; left:0px; width: 150px; /* overvej at gøre det elastisk */ height:100%; background-image: url(../GFX/Background.GIF); background-repeat: repeat; z-index: 1; } #rightmenu { top: 75px; padding: 0 10px 0 10px; /*det bestemmer du selv */ position:absolute; right:0px; background-image: url(../GFX/Background.GIF); background-repeat: repeat; z-index: 1; } #content { padding-top: 150px; margin: 0 150px 0 150px; background-color: green; height: 100%; z-index: 0; }