CSS - Expanding A Column
Hey guys,
I've got a two column layout, and I want both columns to be the same height inside the wrapper. Ussually when I do this sort of thing I have a repeating background image or something so it makes it appear they are both the same height, except this template is using rounded corners, so a repeating background won't work. Code: #wrapper{ width:962px; margin: 25px auto; } #mainContent{ width:735px; background-color: #F4FEFE; padding:0px; border:0px; float:left; } #rightColumn{ background-color: #F4FEFE; width:207px; height:100%; min-height:100%; float:left; margin-left:20px; } Click here to see what I'm talking about... I want that right column to match the height of the main content div. Would this only be possible using JavaScript or is there a CSS solution? Similar TutorialsI created a simple 2 column layout, by using floats. The problem I am running into with this layout, is when the right column's height expands; the left column's height does not expand. What do I need to do, to my code; too make both columns expand the to the same height; regardless of how much content is in each side? CSS Code: Original - CSS Code /* Document Settings - Begin */ body { text-align:center; /* for IE */ margin:0; background:silver url('bg_test2.5.jpg'); } /* Document Settings - End */ /* Layout Structure - Begin */ #wrapper { text-align:left; width:900px; margin:0 auto; border:solid 1px black; height:auto; overflow:auto; background:white; } #header { background: #000 url('ch_banner.JPG') no-repeat 50% 0%; height:146px; } #left_side { float:left; width:200px; background:#B22222; height:100%; border-right:solid 1px black; font-family:arial; } #rite_side { float:right; width:695px; background:white; height:100%; font-family:arial; color:#B22222; } #designer { text-align:left; width:900px; margin:0 auto; background:black; color:white; font-family:arial; font-size:14px; text-align:center; padding-top:3px; padding-bottom:3px; } /* Layout Structure - End */ /* Document Settings - Begin */ HTML Code: Original - HTML Code <div id="wrapper"> <div id="header"></div> <div id="left_side"> <div id="nav"> <ul> <li><a href="#1">Our Tradition</a></li> <li><a href="#2">Menu</a></li> <li><a href="#3">Wines</a></li> <li><a href="#4">Events</a></li> <li><a href="#5">Specials</a></li> <li><a href="#6">Days & Hours</a></li> <li><a href="#7">Contact Information</a></li> </ul> </div> </div> <div id="rite_side"> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> </div> </div> <div id="designer"> </div> <div id="wrapper"> <div id="header"></div> <div id="left_side"> <div id="nav"> <ul> <li><a href="#1">Our Tradition</a></li> <li><a href="#2">Menu</a></li> <li><a href="#3">Wines</a></li> <li><a href="#4">Events</a></li> <li><a href="#5">Specials</a></li> <li><a href="#6">Days & Hours</a></li> <li><a href="#7">Contact Information</a></li> </ul> </div> </div> <div id="rite_side"> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> Line of Text Here<br/> </div> </div> <div id="designer"> </div> Hello, I started off trying to find a content box that expands depending on screen res because the last one I made would break in the middle if the users screen res was over 1600px wide. This box worked great with the screen res but now I'm trying to put content in it and my content is not expanding the box down. Instead of pushing the box lower and forcing a scroll bar. The content keeps going down past the bottom of the box and makes a scroll bar. Any idea how I can make the box expand with my content? here is a link to my test page. http://www.gamerunion.com/test.html My css code. Code: div#case { position:absolute; z-index:1; top:200px; left:50px; bottom:50px; right:50px; background:url(/assets/images/tile.png) repeat; } div#tlcorner span, div#trcorner span, div#blcorner span, div#brcorner span, div#lftile span, div#rttile span, div#tptile span, div#btmtile span { width:0; height:0; overflow:hidden; display:block; } div#tlcorner { position:absolute; z-index:10; top:0; left:0; background:url(/assets/images/corners.png) -369px 0 no-repeat; width:123px; height:123px; } div#trcorner { position:absolute; z-index:10; top:0; right:0; background:url(/assets/images/corners.png) -246px 0 no-repeat; width:123px; height:123px; } div#blcorner { position:absolute; z-index:10; bottom:0; left:0; background:url(/assets/images/corners.png) 0 0 no-repeat; width:123px; height:123px; } div#brcorner { position:absolute; z-index:10; bottom:0; right:0; background:url(/assets/images/corners.png) -123px 0 no-repeat; width:123px; height:123px; } div#lftile { position:absolute; z-index:5; top:0; left:0; bottom:0; background:url(/assets/images/lr.png) -20px 0 repeat-y; width:20px; } div#rttile { position:absolute; z-index:5; top:0; right:0; bottom:0; background:url(/assets/images/lr.png) 0 0 repeat-y; width:20px; } div#tptile { position:absolute; z-index:5; top:0; right:0; left:0; background:url(/assets/images/tb.png) 0 0 repeat-x; height:123px; } div#btmtile { position:absolute; z-index:5; bottom:0; right:0; left:0; background:url(/assets/images/tb.png) 0 -123px repeat-x; height:123px; } div#case div.content { position:absolute; z-index:10; width:100%; min-height:400px; overflow:hidden; } div#case div.content h1 { font-family: "Times New Roman", serif, sans-serif, Arial; font-size:16px; color:#000000; margin:5px 0; padding:100px 0 0 100px; text-align:left; text-transform:capitalize; } div#case div.content p { font-family: "Times New Roman", serif, sans-serif, Arial; font-size:14px; color:#000000; text-align:justify; padding:0 100px; } HTML Code: <body> <div id="header"> <h1 class="small">GamerUnion</h1> <h2 class="small">For Gaming Addicts by Gaming Addicts.</h2> </div> <div id="case"> <div id="tlcorner"><span>top left corner</span></div> <div id="trcorner"><span>top right corner</span></div> <div id="blcorner"><span>bottom left corner</span></div> <div id="brcorner"><span>bottom right corner</span></div> <div id="tptile"><span>top side tile</span></div> <div id="lftile"><span>left side tile</span></div> <div id="rttile"><span>right side tile</span></div> <div id="btmtile"><span>bottom side tile</span></div> <div class="content"> <div id="nav"> <ul> <li><a href="/" class="current">Home</a></li> <li><a href="/about.html">About</a></li> <li><a href="/forum/">Forum</a></li> <li><a href="/resources.html">Resources</a></li> <li><a href="/contact.html">Contact</a></li> </ul> </div> <h1>Gamerunion</h1> <p>Text text text text</p> <p>Text text text text</p> <p>Text text text text</p> <p>Text text text text</p> <p>Text text text text</p> <p>Text text text text</p> <p>Text text text text</p> <p>Text text text text</p> <p>Text text text text</p> <p>Text text text text</p> <p>Text text text text</p> <p>Text text text text</p> <p>Text text text text</p> <p>Text text text text</p> <p>Text text text text</p> <p>Text text text text</p> <p>Text text text text</p> <p>Text text text text</p> <p>Text text text text</p> <p>Text text text text</p> </div> </div> </body> Hi all, I've tried searching around for this issue, but I've not found any help so far and it's driving me nuts. I hope someone here can advise. This is an abridged version of the site's code for example: Code: <style type="text/css"> <!-- #main1 { padding: 0px; margin: 0px; } #left { width:260px; margin:0; padding:0; float: left; } #left-top { background-image: url(../images/panel-top-left.gif); background-repeat: no-repeat; background-position: center top; height: 16px; margin: 0px; padding: 0px; } #left-middle { background-image: url(../images/panel-middle-left.gif); background-repeat: repeat-y; padding-right: 20px; padding-left: 20px; padding-bottom: 2px; } #left-bottom { background-image: url(../images/panel-bottom-left.gif); background-position: center; height: 18px; } #logo { background-image: url(../images/swalingslogo.gif); background-position: center top; width: 260px; height: 120px; background-repeat: no-repeat; } /* Navigation List */ #navlist { padding-left: 0; margin-bottom:10px; width: 217px; } #navlist li { list-style: none; margin-bottom:4px; padding: 0; font-size:1.2em; line-height:1.8em; width:217px; height:32px; background-image:url(../images/nav2.gif); background-repeat:no-repeat; margin-top: 0; margin-right: 0; margin-left: 0; } #navlist li a:link, #navlist li a:visited { display:block; text-decoration: none; color:#039; width:207px; height:32px; font-weight:bold; padding-top: 2px; padding-right: 5px; padding-bottom: 2px; padding-left: 5px; } #navlist li a:hover { text-decoration: none; color:#FF6600; } /* Testimonials */ div#fscroller { width:200px; height:200px; background-image:url(../images/bg-testimonials.gif); background-repeat:no-repeat; margin-left:8px; } div#fscroller p { margin-left: 10px; margin-right: 10px; margin-top: 10px; margin-bottom: 5px; } /* Middle Column */ #middle { margin-top: 0; margin-right: 0px; margin-bottom: 0; padding-right: 0px; padding-left: 0px; padding-top: 0px; text-align: justify; margin-left: 260px; } #middle #top-left { background-image: url(../images/panel-top-rightleft.gif); height: 16px; font-size: 2px; background-repeat: no-repeat; } #middle #top-right { float: right; margin-top: -16px; background-image: url(../images/panel-top-rightright.gif); height: 16px; width: 20px; font-size: 2px; } #middle a { color: #003399; } #middle a:hover { text-decoration: none; } /** Country Titles **/ #middle h2#unitedkingdom { background-image: url(../images/title-unitedkingdom.gif); background-repeat: no-repeat; height: 26px; width: 201px; margin-bottom: 6px; } #middle h2#antigua { background-image: url(../images/title-antigua.gif); background-repeat: no-repeat; height: 26px; width: 128px; margin-top: 16px; margin-bottom: 6px; } /* Minisite Links */ div.minisite { float: left; } div.minisite span { display: none; } div.minisite a { background-position: top; background-repeat: no-repeat; height: 168px; width: 190px; display: block; } div.minisite a:hover { background-position: bottom; } a#minisite-swimminglessons { background-image: url(../images/swimming-lessons-uk.jpg); } .clear { clear:both; } .hidden { display: none; } .notopgap { margin-top: 0; } .nobottomgap { margin-bottom: 0; } .inside { background: #EFEFEF; padding-left: 10px; padding-right: 10px; } --> </style> <div id="main1"> <div id="left"> <!-- Logo --> <div id="logo"></div> <div id="left-top"></div> <div id="left-middle"> <!-- Navigation --> <!--#include file="../inc/nav2.asp" --> <!-- Testimonials --> <!--#include file="../inc/testimonials.asp" --> <!--#include file="../inc/special-offers.asp" --> </div> <div id="left-bottom"></div> </div> <!-- Middle Column --> <a name="skipnav" class="hidden"></a> <div id="middle"> <div class="top-left"></div><div class="top-right"></div> <div class="insideleft"><div class="insideright"><div class="inside"><div class="gap-saver"></div> <!-- UK Sites --> <h2 id="unitedkingdom"><span class="hidden">United Kingdom</span></h2> <div class="minisite"><a id="minisite-swimminglessons" href="(URL address blocked: See forum rules)"><span>Swimming Lessons</span></a></div> <div class="minisite"><a id="minisite-swimminglessons" href="(URL address blocked: See forum rules)"><span>Swalings Training</span></a></div> <div class="minisite"><a id="minisite-swimminglessons" href="(URL address blocked: See forum rules)"><span>Swalings Residential Courses</span></a></div> <div class="clear"></div> <!-- Antigua Sites --> <h2 id="antigua"><span class="hidden">Antigua</span></h2> <div class="minisite"><a id="minisite-swimminglessons" href="(URL address blocked: See forum rules)"><span>Swalings Soccer</span></a></div> <div class="minisite"><a id="minisite-swimminglessons" href="(URL address blocked: See forum rules)"><span>Swalings Parties and Events</span></a></div> <div class="minisite"><a id="minisite-swimminglessons" href="(URL address blocked: See forum rules)"><span>Swalings International School of Swimming</span></a></div> <div class="minisite"><a id="minisite-swimminglessons" href="(URL address blocked: See forum rules)"><span>Swalings Babysitting and Nanny Agency</span></a></div> <div class="minisite"><a id="minisite-swimminglessons" href="(URL address blocked: See forum rules)"><span>Swalings School of Rugby</span></a></div> <div class="minisite"><a id="minisite-swimminglessons" href="(URL address blocked: See forum rules)"><span>Swalings School of Volleyball</span></a></div> <div class="minisite"><a id="minisite-swimminglessons" href="(URL address blocked: See forum rules)"><span>Swalings Training</span></a></div> <div class="clear"></div> <div class="gap-saver"></div> </div></div></div> <div class="bottom-left"></div><div class="bottom-right"></div> </div> <!-- End Middle Column --> </div> I've placed the Country Title in an H2 tag, then beneath that, each anchor is enclosed in a DIV, and is set as a left-floated block. Then I placed a spacer DIV (clear: both) to create a new line, then repeated with H2 and links. This all works fine in Firefox, IE7 and Opera, but of course IE6 is being a pig as usual. The spacer DIV is pushed to sit alongside the bottom of the left column, and I can't figure out how to (or if I can) stop this. I can't add in links properly, so I hope this is acceptable under the rules -- The site in question is: www.swalings .com/swalings/index4.asp and here's a screenshot of IE6 behaviour: www.swalings .com/images/swalings-ie6-troubleshoot.jpg Hopefully that's enough information to go on, please let me know if there's something I missed out. Thanks a lot! Rob Hi I am trying to make a table to display some stuff within a fix sized window. I want to have 5 columns of fixed width and one column that spans the rest of the remaining space. The Idea is to allow the widths of the first 5 columns to be changed by a script and having the last one adapting as needed... html Code: Original - html Code <div class="container"><table cellspacing="0"> <colgroup> <col width="40" /> <col width="220" /> <col width="120" /> <col width="65" /> <col width="40" /> </colgroup> <thead> <tr> <th>A</th> <th>B</th> <th>C</th> <th>D</th> <th>E</th> <th style="width: 100%;></th> </tr> </thead> <tbody> <tr> <td>1</td> <td>2</td> <td>3</td> <td>4</td> <td>5</td> <td style="width: 100%;></td> </tr> </tbody> </table></div> <div class="container"><table cellspacing="0"> <colgroup> <col width="40" /> <col width="220" /> <col width="120" /> <col width="65" /> <col width="40" /> </colgroup> <thead> <tr> <th>A</th> <th>B</th> <th>C</th> <th>D</th> <th>E</th> <th style="width: 100%;></th> </tr> </thead> <tbody> <tr> <td>1</td> <td>2</td> <td>3</td> <td>4</td> <td>5</td> <td style="width: 100%;></td> </tr> </tbody> </table></div> css Code: Original - css Code div.container { height: 400px; width: 800px; overflow: scroll; } table { width: 100%; } td { border-style: solid; border-color: silver; border-width: 0px; padding: 1px 3px; } th { border-style: outset; border-color: silver; border-width: 2px; background: silver; padding: 1px 3px; }
It really does fill the entire space but the last column crushes all the other into their minimal width resulting in linebreaks between words inside the cells... Please help me Hey, So I have a three column layout being implemented as such: html: Code: <div class="content"> <div class="col1 column"></div> <div class="col3 column"></div> <div class="col2 column"> <div class="header">Header</div> </div> </div> CSS: Code: .column { padding: 10px; position:relative; } .header { background:#cfe6f5; color:#416383; font-size:11px; font-family:Arial; font-weight:300; padding-left:15px; } .col1 { float: left; width:250px; } .col2 { margin-left: auto; margin-right: auto; } .col3 { float:right; width:250px; } The problem is that the width of the header div extends all the way to the left and right of the page when it's in the middle column, but behaves the way I want it to (extends to the left and right of the column) when it's in the left or right column. Any ideas? Thanks. --Surgery Question title: A 2 column layout, let only the second column scroll horizontally and let them both scroll vertically Hello I did try several idea's, but all failed. Then I did search the web but found a list of > 400.000 in google. If someone is willing to tell me if it is possible and give me some directions, please do. Everything is welcome. I got a list with 3 columns ( basically you could say I have only two columns because 2-3 could be concatenated to together, but they have a different style and justification, but I could live to start with a two column sample) f.e line 1 : value_one - ( some_text - value_two (right justified) ) line 2 : value_one - ( some_text - value_two (right justified) ) line 99:.... e.t.c Column one has a fixed width of 32px. 'some text' can be longer then the wide available and value_two is with 3 spaces appended to column 2. I want that column one is fixed horizontal and that the second and the third column can scroll horizontally. Of course when there are more line's then the height of the container is should be posable to scroll vertically. Finally I need the color behind column one be different then the column 2 and 3. So what I did create is a container with two containers where the left one has a different colour then the right one and above those a container with the list. I have overflow on auto, so I get scroll-bars when necessarily. But my problem is that when I scroll horizontally that my first column scrolls away to the left. Basically my question is. How can I get a 2 column layout, let only the second column scroll horizontally ( first is locked in horizontal place ) and let them scroll both vertically? can i make my left column, the same height as my right column? or infact, if the left is taller than the right, the right extends to it and if the right is taller than the left the left extends to it? is this possible, cheers heres my css: left column, is #leftNav and the right column is #contentMain PHP Code: #content { margin:0px auto; padding: 0; width: 760px; } #contentMain { padding: 0; margin: 0; float: right; width: 632px; } #leftNav { color: #000; float: left; margin: 0; padding: 0; width: 128px; } Hello, I am having difficulty with the center column on the following page: http://cbo4edu.org/index2.html I want to widen the center column so that the CBO NEWS heading touches the blue line which divides the center and right column. When I try to add width to the style sheet the left column moves out of alignment. Any help is much appreciated, thanks! Hi, hopefully you enjoyed the title, I had a good laugh thinking of it in that split second it took me to write it. So, I found a 3 column css layout on a CSS generator website, because I got sick of trying to hack up layouts I've made in the past that didn't work. Anyhow, it was working fine with one line of content in each column when I tested it out, however, once content in the middle column was added, and stretched vertically beyond a certain point, it will drag the left columns content down with it. The right column is not affected in any way. I have spent a few hours trying to look for reasons as to why it would happen, but I had no luck. I would appreciate any help... so thank you in advance if you take a stab at it. Here's the html: Code: <body> <div id="pagewidth"> <div id="header"></div> <div id="wrapper" class="clearfix" > <div id="twocols" class="clearfix"> <div id="maincol">Main Text, woot. (aka hi hi hi)</div> <div id="rightcol">Sidebar, yippee.</div> </div> <div id="leftcol"> <div id="navigation">test</div> </div> </div> <div id="footer"></div> </div> </body> and the CSS: Code: html, body { background: #333399; margin:0; padding:0; text-align:center; font-family: Verdana, Arial, Tahoma; font-size: 12px; font-weight: normal; color: black; } #pagewidth { width: 750px; text-align:left; margin-left:auto; margin-right:auto; background: #333399 url('images/bodycontent.gif') repeat-y center top; } #header { position:relative; height:138px; background: url('images/header.gif') center; width: 100%; } #leftcol { width: 118px; float: left; left: 25px; position: relative; background-color: transparent; margin:0; padding:0; } #twocols { width: 700px; float: right; position: relative; } #rightcol { width:180px; right: 25px; float:right; position:relative; background-color: transparent; } #maincol { background-color: transparent; float: left; left: 100px; display: inline; position: relative; width: 390px; } #footer { text-align: center; height:39px; background: url('images/footer.gif'); clear:both; } .clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } .clearfix{display: inline-table;} /* Hides from IE-mac \*/ * html .clearfix{height: 1%;} .clearfix{display: block;} /* End hide from IE-mac */ /*printer styles*/ @media print{ /*hide the left column when printing*/ #leftcol{display:none;} /*hide the right column when printing*/ #rightcol{display:none;} #twocols, #maincol{width:100%; float:none;} } Again, thank you in advance if you can come up with anything. hi all, right have got a problem which has been bugging me for days now. i have 4 columns in a row (inside a wapper div)which all will have different content image, text other divs/classes etc. now one of these columns will be quite fluid as it will have different text on each page meaning it will be quite long on some pages not on others. the problem i am getting is in the good browsers firefox etc its ok in IE6+. the wapper does'nt seem to see the divs in the content meaning it does not get filled, meaning that the footer flys to the top and not where it should be, i dont have a live version but heres the code: mainly thanks Dan <!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=utf-8" /> <title>Untitled Document</title> <style type="text/css"> <!-- #con { width:940px; height:400px; background-color:#00FFFF; } #wapper { width:940px; background-color:#006666; } #box { width:940px; background-color:#000033; height:40px; } #menu-pronuptia { width:185px; background-color:#6633CC; float:left; display:inline; } #menu-pronuptia1 { width:185px; background-color:#009900; display:inline; float:left; } #menu-pronuptia2 { width:385px; background-color:#0033CC; display:inline; float:left; clear:inherit; } #menu-pronuptia3 { width:185px; background-color:#CCCC33; display:inline; float:left; } --> </style> </head> <body> <div id="wapper"> <div id="menu-pronuptia"> <p>test</p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> </div> <div id="menu-pronuptia1"> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> </div> <div id="menu-pronuptia2"> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> </div> <div id="menu-pronuptia3"> <p> </p> <p> </p> <p> </p> <p> </p> </div> </div> <div id="box"> <p><br /> </div> </body> </html> Hello! I'm new to CSS, so any help would be greatly appreciated! I'm working on this page: sugarhooker[dot]com/testing/index2.html *The CSS is included in the head The right column is suppose to start where it says 'Are you hooked...' It should be right underneath the navigation bar. Anyone know what I'm doing wrong? Thanks in advance! Hi, http://www.dudley.nhs.uk/search.asp has a two column effect. The CSS for it is he http://www.dudley.nhs.uk/css/screen.css I was wondering why if there is a table in the right hand column with a width percentage over 77% there is some horizontal scrolling? This happens in IE. Any help would be greatly appreciated. Thanks. Janusz Jasinski I am a HTML&CSS novice - I am trying to write a page using a three column layout but the column colour doesn't reach the footer. I understand that this is a common problem and I've looked at a lot of examples on the web of how to work around this or create a better layout but I'm still not sure enough to know which would be the easiest and best to go within the page I have written. I want to avoid images but other than that any help would be great! I have validated the HTML & CSS and they are copied below (could any advice be really specific, as I said this is very new to me!). Thanks HTML: <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Drivers Jonas Information Unit</title> <meta name="keywords" content="1" /> <link rel="stylesheet" type="text/css" href="djiucss.css" media="screen" /> <link rel="stylesheet" type="text/css" href="djiuprintcss.css" media="print" /> </head> <body> <div id="top"> <div id="picture"> <img src="GIF.gif" alt="DJ" width="200" height="100" /> </div> <div id="heading"> <div id="title"><h1>Drivers Jonas Information Unit</h1></div> </div> </div> <div id="left"> <br/><p><a href="about.html">About us</a></p><br/> <p><a href="company.html">Company Information</a></p><br/> <p><a href="legal.html">Legal information</a></p><br/> <p><a href="landreg.html">Land Registry</a></p><br/> <p><a href="research.html">Research</a></p><br/> </div> <div id="right"> <div id="title"><h2> News </h2></div> <ul> <li>The Information Unit has recently acquired a set of new APC guides</li> <li>If you would like any training on databases</li> <li>The Information Unit has created an economy timeline </li> </ul> </div> <div id="main"> <div id="title"><h2>Main stuff</h2></div> <p>Suspendisse adipiscing malesuada lectus. Cras vitae dolor. Donec consequat, lectus sed euismod consequat, ipsum mi mollis nunc, eget nonummy neque purus a tortor. Ut vel lorem. Curabitur mollis mauris id diam. Nam posuere. In placerat sapien ut nisl. Donec volutpat augue ut velit. Proin nec mi sit amet metus placerat egestas. Quisque porttitor massa eu lacus. Donec tristique, neque in sollicitudin euismod, enim tellus varius mauris, id vestibulum est massa id massa. Integer et purus. Vivamus condimentum tincidunt ipsum. Duis augue lorem, pretium vel, cursus at, vulputate sed, neque. Quisque justo. Nunc rhoncus. In ornare venenatis velit. </p> <p>Donec facilisis ante sit amet mauris. Nunc fermentum orci eu quam. Donec vestibulum. Vestibulum ultricies nisl eu eros. Curabitur urna. Duis enim erat, lobortis nonummy, mollis non, porttitor nec, nisi. Phasellus pulvinar purus eu pede. In mollis. Duis sit amet dui et arcu rhoncus auctor. Integer est dui, pharetra vel, volutpat ac, luctus in, elit. </p> <p>Suspendisse adipiscing malesuada lectus. Cras vitae dolor. Donec consequat, lectus sed euismod consequat, ipsum mi mollis nunc, eget nonummy neque purus a tortor. Ut vel lorem. Curabitur mollis mauris id diam. Nam posuere. In placerat sapien ut nisl. Donec volutpat augue ut velit. Proin ne</p> </div> <div id="bottom"> Drivers Jonas Information Unit </div> </body> </html> CSS: #top /*DJ logo and page title - includes h1*/ { color: black; font-family: arial, sans-serif; font-size: 20px; background: #d31145; padding-bottom: 15px; } body { color: black; font-family: arial, sans-serif; font-size:14px } img /*DJ logo*/ { padding: 20px; float:left; } #heading { text-align: center; padding:20px; } /*main page title*/ /*should change all reds to DJ red: #d31145*/ #left, #right, #main { color: white; background: black; } #left { float: left; width:140px; border-right:2px solid #d31145; text-align:left; padding-left: 1em; } #right { float:right; width:140px; border-left:2px solid #d31145; text-align:left; padding-right: 1em; } #main { margin-left: 150px; margin-right: 150px; border-left: 1px solid; border-right: 1px solid; padding: 1em; } #bottom { clear:both; margin: 0; color:black; background: #d31145; font-size: 16px; font-family: Arial, sans-serif; text-align: center; } #title { text-align:center; } a:link {color:white} a:visited {color:silver} a:hover {color:#d31145} a:active {color:#d31145} You can see the problem he BrianRoyer.com The google adsense ad is expanding past the container. Here is my style.css for troubleshooting: Code: html, body { background: #a0a0a0 url(images/main_bg.gif) center top repeat-x; height: 100%; margin-top: 0px; margin-bottom: 0px; height: 100%; } a:link { color: #FFFFFF; text-decoration: underline; } a:visited { color: #FFFFFF; text-decoration: underline; } a:hover { color: #FFFFFF; text-decoration: none; } a:active { color: #FFFFFF; text-decoration: none; } #container { width: 703px; margin: 0 auto; background: #068add url('images/content_bg.gif'); border-left: 5px solid #cdcdcd; border-right: 5px solid #cdcdcd; border-bottom: 5px solid #cdcdcd; } #content em.u { text-decoration: underline; font-style: normal; } #top { padding: 0; border: 0; } #top img { border: 0; } #top h1 { padding: 0; margin: 0; } #leftnav { float: left; width: 160px; margin: 0; padding: .25em 0 0 .75em; } #rightnav { float: right; width: 125px; margin: 0; text-align: center; padding: 1em 1em 0 0; } #rightnav img { margin: 0; border: 0; text-align: center; padding: 1em 0 0 0; } #content { margin-left: 200px; margin-right: 200px; padding: 1em 0 0 0; width: 290px; } #content img.left { margin: 5px; border: 1px solid #000000; float: left; } #content img.right { margin: 5px; border: 1px solid #000000; float: right; } #leftnav img { margin: 0; border: 0; } #google-search img { border: 0; padding: 1em; } #footer { width: 699px; padding-top: 1em; margin: 0 auto; background: #068add url(images/footer_bg.gif) center bottom repeat-x; } #leftnav p, #content p { margin: 0 0 1em 0; text-align: justify; color: #FFFFFF; font-family: Verdana; font-size: 12px; line-height: 130%; } #rightnav p { margin: 0; padding: 0; color: #FFFFFF; font-family: Verdana; font-size: 10px; } #leftnav hr, #content hr, #rightnav hr { color: #FFFFFF; height: 1px; } #content h2 { color: #FFFFFF; font-family: Verdana; font-size: 12px; } #content h2.center { text-align: center; color: #FFFFFF; font-family: Verdana; font-size: 12px; } #leftnav h2, #rightnav h2 { text-align: center; margin: 0; color: #FFFFFF; font-family: Verdana; font-size: 12px; } #content h6, #leftnav h6, #rightnav h6 { text-align: center; margin: 0; padding: 1em; color: #FFFFFF; font-family: Verdana; font-size: 8px; } #navcontainer ul { list-style-type: none; text-align: left; padding: 0 0 0 1.25em; margin: 0; } #navcontainer ul li a { background: transparent url(images/list_off.gif) left center no-repeat; padding-left: 15px; text-align: left; font: normal 10px Verdana; text-decoration: none; color: #FFF; } #navcontainer ul li a:hover { background: transparent url(images/list_on.gif) left center no-repeat; color: black; } #navcontainer ul li a#current { background: transparent url(images/list_active.gif) left center no-repeat; color: #666; } And here is snippet of code where the adsense ad is located: Code: <div id="container"> <div id="top"> <? include("ssi/header.inc"); ?> </div> <div id="leftnav"> <? include("ssi/leftnav.inc"); ?> </div> <div id="rightnav"> <? include("ssi/rightnav.inc"); ?> </div> <div id="content"> ad = rightnav.inc ive been at this for a while now. i have a navleft.gif, navbody.gif, and navright.gif. what i want to do is make an expandable nav bar with the body repeating on the x axis. every attempt ive made doesnt work. im still fairly new to css. should i have a <div id="nav"> and within this div put a another div with id=navleft and another with navright? no idea how to go about this. any help would be appreciated. Hello. Trying to construct a page with vertical expansion on both of two nested DIVs. Left column is primarily text which varies in length. Right column is a navigation/contact panel that is mostly fixed height, but want ability to drop in objects and expand vertically on some pages. I have tried to background image in container DIV, but I am still getting the content breaking out of the bottom of the DIV. Any other approaches? Min-height (could not get that to work either). Ideally I would like for these to have the same height. Not shading, so it doesn't need to be exact. Here's a sample of code (w/o all the junk). Hi all, I have a site where I have several divs that stack on top of each other for layout purposes and they fill the entire width of the screen. In the div that contains the content, I'm finding a rare case where a table appears that's so wide, it is off the edge of the content element. I wanted to do overflow:auto so that it wouldn't mess up the layout but the customer wants the layout to expand with the content. Since all these divs sit on top of each, they aren't really interacting with the div that has the content in it. Is the only way to make those expand to use JavaScript to detect the width and adjust on the fly or is there a better way to do it? I'll be happy to supply some code if you all need me to but its a lot so I'll hold off on that for now. hi, Im making a site, and i decided to use CSS instead of tables. I have used basic CSS before, but it gets abit harder when i start making boxes etc. Here is my code so far - layout.css - (one that gets included on each page) Code: @import "style.css"; body { margin:10px 10px 0px 10px; padding:0px; } #leftcontent { position: absolute; left:10px; top:50px; width:200px; background:#fff; border:1px solid #000; } #centercontent { background:#fff; margin-left: 199px; margin-right:199px; border:1px solid #000; voice-family: "\"}\""; voice-family: inherit; margin-left: 201px; margin-right:201px; } #shoutbox { position: absolute; right:10px; top:50px; width:200px; background:#fff; border:1px solid #000; } #rightcontent { position: absolute; right:10px; top:50px; width:200px; background:#fff; border:1px solid #000; } #banner, #footer { background:#fff; height:40px; border-top:1px solid #000; border-left:1px solid #000; border-right:1px solid #000; voice-family: "\"}\""; voice-family: inherit; height:39px; } #footer { background:#fff; height:40px; border-bottom:1px solid #000; border-left:1px solid #000; border-right:1px solid #000; voice-family: "\"}\""; voice-family: inherit; height:39px; } #banner h1 { font-size:16px; padding:10px 10px 0px 10px; margin:0px; } #shoutbox, #rightcontent p { font-size:10px } style.css - text formatting etc. Code: body { font: 12px/1.2 Tahoma; background:#ddd; padding:0px; margin:0px; } a { text-decoration:none; font-weight:bold; color:#c00; } pre { font-size:11px; color:blue; } ol { margin-right:40px; } li { margin-bottom:10px; } p,h1,pre { margin:0px 10px 10px 10px; } h1 { font-size:14px; padding-top:10px; } it produces a good layout, with a header, 3 coloums and a footer. whoever, the boxes expand at different rates and the footer doesnt move down. the header also doesnt expand. i know how i can fix this, but i dont know how to fix it without making it so that its locked at a resolution. i would like the site to exapand as the window is made larger. here is an image of what i get - and this is what i am aiming to acheive - as you can see, i want all the boxes to be the same length, which is defined by the size of the largest box. also, i want to create 2 or more boxes on the left, only the bottom of which gets made longer. on the first image you cannot see the extra box because it is covered by the other one :-/ i would be greatful for any help you guys can provide me thanks, dynamyt I think that this is something really basic but I just haven't been able to put my finger on the problem. Can someone please point me in the right direction? In IE 6 the cell background (as defined in CSS) or the table cell size is not correct, but it looks fine in FF. The test page is: http://www.kdays.com/box/kerrin.htm going bonkers, I have tried everything to find out why on earth the background goes all the way to the right when this page is viewed in IE.. Black Background Not Stoping!! |