• Jetzt anmelden. Es dauert nur 2 Minuten und ist kostenlos!

3 Spalten (left,main,right) mit unterschiedlichem Background - Gleiche Höhe?

hawkeye

Neues Mitglied
Ich komme einfach nicht klar damit. Mit tables kann ich dass in 5 Sekunden, mit CSS scheint es ein Ding der Unmöglichkeit zu sein.

Ich möchte nur dass die drei Spalten immer gleich lang sind (min 600px), wenn aber die main spalte 900px lang ist, sollen die beiden äusseren auch 900px lang sein.



Uploaded with ImageShack.us

Code:
<body>

<div id="body">

<div id="container">
 
<div id="header">
  <jdoc:include type="modules" name="header" style="none" />
<!-- end #header --></div>

<div id="maincontainer">

<div id="leftbar">
  <jdoc:include type="modules" name="left" style="none" />
<!-- end #leftbar --></div>  
    
<div id="rightbar">
  <jdoc:include type="modules" name="right" style="none" />
<!-- end #rightbar --></div>  

<div id="maincontent">
  <jdoc:include type="component" />
<!-- end #maincontent --></div>

<!-- end # maincontainer --></div>

<div id="footer">
  <jdoc:include type="modules" name="footer" style="none" />
<!-- end #footer --></div>

<!-- end #container --></div>

<!-- end #body --></div>

</body>
</html>

HTML:
body {
    font-family: Helvetica, Verdana, Georgia, Arial, sans-serif;
    font-size: 12px;
     background-image:url(ia04_hp_bg_2.png);
    margin: 0px;
    padding: 0px;
    color: #000000;
    line-height: 120%;
}

h1 {
    font-family: old English Text MT, Helvetica, Verdana, Arial;
    font-size: 25px;
    font-weight: 100;
}

#body {
    text-align: center;
    width: 100%;
    height: 100%;
}

#container {
    position:relative;
    top: 30px;
    min-width: 800px;
    max-width: 1000px;
    background: transparent;
    margin: 0px auto;
    border: 0px solid #000000;
    text-align: left;
}

#header {
    height: 100px;
    background:url(../images/banner.gif);
    padding: 0px 0px 0px 0px;
    -webkit-border-radius: 20px;
    -moz-border-radius: 20px;
    border-radius: 20px;
}

#maincontainer {
    min-height: 600px;
}    

#leftbar {
    position: absolute;
    top: 100px;

    left: 0px;
    width: 170px;
    background: #FFFFFF;
    padding: 5px 5px 5px 5px;
    text-align: center;
    -webkit-border-top-left-radius: 20px;
    -moz-border-radius-topleft: 20px;
    border-top-left-radius: 20px;
    }
    
#rightbar {
    position: absolute;
    top: 100px;

    right: 0px;
    width: 170px;
    background: #CCCCCC;
    padding: 5px 5px 5px 5px;
    text-align: left;
    -webkit-border-top-right-radius: 20px;
    -moz-border-radius-topright: 20px;
    border-top-right-radius: 20px;
}

#maincontent {
    background:#FFF;
    top: 100px;

    margin: 0px 180px;
    padding: 5px 10px 5px 10px;
}
.text {
    margin-bottom: -5px;
    }

#footer {
    padding: 0px 10px 0px 20px;
    background: #DDDDDD;
    line-height: 1.5;
    -webkit-border-bottom-right-radius: 20px;
    -webkit-border-bottom-left-radius: 20px;
    -moz-border-radius-bottomright: 20px;
    -moz-border-radius-bottomleft: 20px;
    border-bottom-right-radius: 20px;
    border-bottom-left-radius: 20px;
}

Ich habe es auch schon mit CSS Layout Generatoren versucht, aber die lösen das Problem irgendwie auch nicht. Ich kann mir nicht vorstellen dass es etwas grosse sein kann. Ich freue mich über eure Tipps!
 
Es geht auch anders als wie mit Tabellen.
Grundsätzlich gibt es hier verschiedene lösungsansetze. Du kannst es anstelle der Faux Colums mal mit "min-height" und "max-height" versuchen. Allerdings musst du hier bedenken das dies nicht alle Browser untersützen.
Du kannst denen ja auch die gleiche hintergrundfarbe geben und nur mit Linien abtrennen. Das würde zuminderst so aussehen.
 
Es geht auch anders als wie mit Tabellen.
Grundsätzlich gibt es hier verschiedene lösungsansetze. Du kannst es anstelle der Faux Colums mal mit "min-height" und "max-height" versuchen. Allerdings musst du hier bedenken das dies nicht alle Browser untersützen.
Du kannst denen ja auch die gleiche hintergrundfarbe geben und nur mit Linien abtrennen. Das würde zuminderst so aussehen.

Ich habe es nun so gelöst:




Leider habe ich einen Abstand vor dem Footer den ich mir einfach nicht erklären kann. Woran könnte das liegen?

Code:
/* top bar nav on top of template good for staic links link sections etc.*/
.topbar{
color:#fff;
background-color:#222;
/*ajust the top bar height*/
height:30px;
text-align:right;
text-decoration:none;
padding-top:5px;
padding-right:5px;
display:block;
white-space:nowrap;
}
.topbar a:link{color:White;}
.topbar a:visited{color:White;}
.topbar a:hover{color:White;}

/* Wrapper Footer Trick */
#Wrapper {
height:auto !important;
/*this works hand in hand with the #FooterWrapper min-height: settings */
min-height:90%;
}

/* Heading Color and Height control*/
#Header {
background-image:url(../images/brb.png);
background-repeat: repeat-x;
}

/*Menu Wrapper to cover the width if needed*/
#MenuWrapper{
    background-color:#333;
    width:100%;
    height:25px;
    white-space:nowrap;
    /*need for  FF div not working right*/
    margin:0 auto;
    padding-top:5px;
    }

/* Main Body Padding */
.MainBody{padding:8px;}
    
/* Start of layout Center Mass */
body {
    font-family: Helvetica, Verdana, Georgia, Arial, sans-serif;
    font-size: 12px;
     background-image:url(ia04_hp_bg_2.png);
    margin: 0px;
    padding: 0px;
    color: #000000;
    line-height: 120%;
}

h1 {
    font-family: old English Text MT, Helvetica, Verdana, Arial;
    font-size: 25px;
    font-weight: 100;
}

#body {
    text-align: center;
    width: 100%;
    height: 100%;
}

#container {
    position:relative;
    top: 30px;
    min-width: 800px;
    max-width: 1000px;
    background: transparent;
    margin: 0px auto;
    border: 0px solid #000000;
    text-align: left;
}

#header {
    height: 100px;
    background:url(../images/banner.gif);
    padding: 0px 0px 0px 0px;
    -webkit-border-radius: 20px;
    -moz-border-radius: 20px;
    border-radius: 20px;
}

#maincontainer {
    background:#FFF;
    -webkit-border-top-left-radius: 20px;
    -moz-border-radius-topleft: 20px;
    border-top-left-radius: 20px;
    -webkit-border-top-right-radius: 20px;
    -moz-border-radius-topright: 20px;
    border-top-right-radius: 20px;
}    

#leftbar {
    position: absolute;
    top: 100px;
    min-height: 600px;
    left: 0px;
    width: 170px;
    padding: 5px 5px 5px 5px;
    text-align: center;
    -webkit-border-top-left-radius: 20px;
    -moz-border-radius-topleft: 20px;
    border-top-left-radius: 20px;
    }
    
#rightbar {
    position: absolute;
    top: 100px;
    min-height: 600px;
    right: 0px;
    width: 170px;
    padding: 5px 5px 5px 5px;
    text-align: left;
    -webkit-border-top-right-radius: 20px;
    -moz-border-radius-topright: 20px;
    border-top-right-radius: 20px;
}

#maincontent {
    top: 100px;
    min-height: 600px;
    margin: 0px 180px;
    padding: 5px 10px 5px 10px;
    border-right:dotted;
    border-right-color:#000;
    border-left:dotted;
    border-left-color:#000;
}
.text {
    margin-bottom: -5px;
    }

#footer {
    background: #DDDDDD;
    line-height: 1.5;
    -webkit-border-bottom-right-radius: 20px;
    -webkit-border-bottom-left-radius: 20px;
    -moz-border-radius-bottomright: 20px;
    -moz-border-radius-bottomleft: 20px;
    border-bottom-right-radius: 20px;
    border-bottom-left-radius: 20px;
}

/* End of layout Center Mass */

Centers the footer links etc.
/*.center{margin:0 auto;text-align: center; }*/
#FooterWrapper{
padding:10px;
clear:both;    
/*this works hand in hand with the #Wrapper min-height: settings */
min-height:10%;
background-color: #222;
}

Code:
<body>

<div id="body">

<div id="container">
 
<div id="header">
  <jdoc:include type="modules" name="header" style="none" />
<!-- end #header --></div>

<div id="maincontainer"> 

<div id="leftbar">
  <jdoc:include type="modules" name="left" style="none" />
<!-- end #leftbar --></div>

<div id="maincontent">
  <jdoc:include type="component" />
<!-- end #maincontent --></div>

<div id="rightbar">
  <jdoc:include type="modules" name="right" style="none" />
<!-- end #rightbar --></div>

<!-- end #maincontainer --></div>

<div id="footer">
  <jdoc:include type="modules" name="footer" style="none" />
<!-- end #footer --></div>

<!-- end #container --></div>

<!-- end #body --></div>

</body>
 
Zurück
Oben