CSS - Three Column Layout: Middle Column Width Woes
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 Similar TutorialsHi everyone! i have this mockup in fireworks for my personal site.. problem is... i cant put it together the way i like it using CSS here is my mockup and the slices ive made... http://www[dot]phpugph[dot]com/talk/index.php?action=dlattach;topic=8005.0;attach=1720;image im sorry for the link... i cant seem to post a proper one do u guys know how i should go about it? the middle column should be fixed width but the right and left column should be fluid thanx 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! I am jsut interested as to how you would go about creating a three column layout. The way im doing it at the moment is as follows Code: #left { float: left; width: 176px; margin: 0px; } #right { float: right; width: 176px; margin: 0px; } #content { margin: 0px 186px; } Code: <div id="left"></div> <div id="right"></div> <div id="content"></div> The above works very well UNLESS i want to put in a table of width="100%". If i do this then the content div falls below the left and right divs. By setting the width to 99% it then works again but i really need it to be 100% wide within the content div. One other thing, this works fine in firefox but falls in IE. Can anyone give me a clue as to why i am unable to do this and secondly a method to fix it? Thanks so much Andy I need a combination of this: http://bonrouge.com/3c-hf-fixed.php and this: http://bonrouge.com/3c-hf-fluid.php I need the middle column to be a fixed width and the outer two to be fluid. I also need to maintain the 100% with header and footer at top and bottom respectively. Any ideas how to do this? Thanks. 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 Alrighty, I'm trying to produce a layout similar to that of what is shown in the attached image. Please ignore the image being the rainbox colors, but I had to differentiate sections. I can get the banner/search line to appear properly, but the rest will not. Left menu gets positioned fine, the content does as well (more or less), but the right column is displaced, and shifted down to the very bottom of the window -- far right, though. I can't explain much better than that, so without further ado: CSS: Code: .columns-float{ float : left; width : 80%; } .column-one { width : 75%; /* NOTE: This needs to be dynamic! THIS is what I'm inquiring about. The above problem assumes this attribute is set to "auto". */ float : right; } .column-two { width : 25%; float : left; } .column-three{ width : 20%; float : right; } .box-footer{ clear : both; } .column-one-content{ margin-left: 1px; margin-right: 1px; } /*Hack below:*/ .box-wrap, .columns-float, .column-one, .column-two, .column-three, h2{ p\osition: relative; } (Above was borrowed from here, albeit with modifications.) HTML: Code: ... <div class="columns-float"> <div class="column-one"> <div class="column-one-content"> <h2>column 1</h2> <p>column filler</p> <p>column filler</p> <p>column filler</p> <p>column filler</p> <p>column filler</p> <p>column filler</p> <p>column filler</p> <p>column filler</p> <p>column filler</p> <p>column filler</p> <p>column filler</p> <p>column filler</p> <p><a href="#" title="fake link for testing">test link</a></p> </div> </div> <div class="column-two"> <div class="column-two-content"> <h2>column 2</h2> <p>column filler</p> <p>column filler</p> <p>column filler</p> <p><a href="#" title="fake link for testing">test link</a></p> </div> </div> <div class="box-clear"> </div><!-- # needed to make sure column 3 is cleared || but IE5(PC) and OmniWeb don't like it --> </div><!-- close boxbody --> <div class="column-three"> <div class="column-three-content"> <h2>column 3</h2> <p>column filler</p> <p>column filler</p> <p>column filler</p> <p><a href="#" title="fake link for testing">test link</a></p> </div> </div> <div class="box-clear"> </div><!-- # needed to make sure column 3 is cleared || but IE5(PC) and OmniWeb don't like it --> <div class="box-footer">Footer </div> Do not link me to Position Is Everything. Been there already, and it wasn't helpful; the used terminology was too abstruse for me. Any help would be appreciated, and I thank you very much for your time. This is driving me batty. Hi, I have a multi-column layout where I want every column to always be the same height. Any one of the columns may be the longest on any given page, so the other columns have to automatically adjust to match that height. Usually I'd just use the faux column technique where you repeat a background image, but that won't work because of two elements on this page: 1. each column has a border all the way around it. 2. one column resizes with the page. I've read the articles on liquid layouts with faux columns, but as far as I can tell those techniques won't work if your columns have borders. Does anyone know any technique that would work here? Thanks. 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? 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! 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} 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 Ive tried to put stuff to the left of the news room in the blank spot and cannot seem to do so.. here is css: Code: #header { position: relative; margin: 0 auto; background: transparent url(img/bg/header-v2.gif) no-repeat bottom left; height: 235px; width: 760px; text-align: left; z-index: 10; } '#content { position: relative; background-color: #FFFFFF; height:inherit; width: 760px; margin: 0 auto 0 auto; text-align: left; border: 1px double rgb(72,183,239); overflow: hidden; font-size: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; } #leftpanel{ position: inherit; float: left; background-color: #f5f5f5; height: inherit; width: 170px; margin-left: 3px; } #leftpanel-head{ width: 158px; height: 26px; background-image: url(img/bg/leftpanel-head.png); padding-left: 12px; color: #FFFFFF; font-weight: bold; font-family: Verdana, Arial, Helvetica, sans-serif; padding-top: 4px; } #content-right { width: 585px; height: inherit; float: right; } #newsroom { float: right; width: 300px; height: 30px; margin-left: 2px; } #newsroom-header { width: 300px; height: inherit; background-image:url(img/bg/video-player-head.png); color: #FFFFFF; font-weight: bold; padding-left: 3px; padding-top: 4px; } #welcome{ float: left; height: 27px; width: 279px; color: #FFFFFF; font-weight: bold; padding-left: 3px; padding-top: 4px; } #welcome-text { float: left; height: 27px; width: 279px; color: #FFFFFF; font-weight: bold; padding-left: 3px; padding-top: 4px; } #primary-nav { position: absolute; background: transparent url(img/bg/primary-nav-v2.gif) no-repeat; list-style: none; width: 760px; height: 26px; top: 203px; left: 1px; z-index: 10; padding-left: 5px; } #primary-nav li { float: left; background-position: 0 -26px; } #primary-nav li ul { position: absolute; background: transparent url(img/primary-nav-top.png) no-repeat; list-style: none; width: 159px; left: -9999px; margin-left: -9px; padding-top: 5px; } #primary-nav a { display: block; height: 0px !important; text-decoration: none; overflow: hidden; } #primary-nav li a { background-position: 0 0; } #primary-nav li#nav-1 { background: transparent url(img/bg/nav-1.png) no-repeat; margin-right: 1px; } #primary-nav li#nav-2 { background: transparent url(img/bg/nav-2-shopping.png) no-repeat; margin-right: 1px; } #primary-nav li#nav-3 { background: transparent url(img/bg/nav-3-restaurants.png) no-repeat; margin-right: 1px; } #primary-nav li#nav-4 { background: transparent url(img/bg/nav-4-hotels.png) no-repeat; } #primary-nav li#nav-5 { background: transparent url(img/bg/nav-5-history.png) no-repeat; } #primary-nav li#nav-6 { background: transparent url(img/bg/nav-6-links.png) no-repeat; } #primary-nav li#nav-7 { background: transparent url(img/bg/nav-7-about.png) no-repeat; } #primary-nav li#nav-1:hover, #primary-nav li#nav-1.sfhover, #primary-nav li#nav-2:hover, #primary-nav li#nav-2.sfhover, #primary-nav li#nav-3.hover, #primary-nav li#nav-3.sfhover, #primary-nav li#nav-4:hover, #primary-nav li#nav-4.sfhover, #primary-nav li#nav-5:hover, #primary-nav li#nav-5.sfhover, #primary-nav li#nav-6:hover, #primary-nav li#nav-6.sfhover, #primary-nav li#nav-7:hover, #primary-nav li#nav-7.sfhover{ background-position: 0 -26px; font-family:Verdana, Arial, Helvetica, sans-serif; } #primary-nav li#nav-1 a, #primary-nav li#nav-2 a, #primary-nav li#nav-3 a, #primary-nav li#nav-4 a, #primary-nav li#nav-5 a, #primary-nav li#nav-6 a, #primary-nav li#nav-7 a { width: 107px; height /**/: 26px; padding: 26px 0 0 0; } #primary-nav li#nav-1 ul li, #primary-nav li#nav-2 ul li, #primary-nav li#nav-3 ul li, #primary-nav li#nav-4 ul li, #primary-nav li#nav-5 ul li, #primary-nav li#nav-6 ul li, #primary-nav li#nav-7 ul li{ background: transparent url(img/bg/primary-nav-link-up.png) no-repeat; height: 21px; } #primary-nav li#nav-1 ul li.bottom, #primary-nav li#nav-2 ul li.bottom, #primary-nav li#nav-3 ul li.bottom, #primary-nav li#nav-4 ul li.bottom, #primary-nav li#nav-5 ul li.bottom, #primary-nav li#nav-6 ul li.bottom, #primary-nav li#nav-7 ul li.bottom{ background: transparent url(img/bg/primary-nav-bottom.png) no-repeat; height: 14px; width: 159px; } #primary-nav li#nav-1 ul li a, #primary-nav li#nav-2 ul li a, #primary-nav li#nav-3 ul li a, #primary-nav li#nav-4 ul li a, #primary-nav li#nav-5 ul li a, #primary-nav li#nav-6 ul li a, #primary-nav li#nav-7 ul li a { overflow: hidden !important; overflow: visible; font-size: 10px; color: #FFF; height: 19px !important; height: 19px; width: 107px; padding: 1px 3px 2px 19px; } #primary-nav li#nav-1 ul li a:hover, #primary-nav li#nav-2 ul li a:hover, #primary-nav li#nav-3 ul li a:hover, #primary-nav li#nav-4 ul li a:hover, #primary-nav li#nav-5 ul li a:hover, #primary-nav li#nav-6 ul li a:hover, #primary-nav li#nav-7 ul li a:hover { background: transparent url(img/bg/primary-nav-link-over.png) no-repeat 0 0; } #primary-nav li:hover ul, #primary-nav li.sfhover ul { left: auto; } html: Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html class="sIFR-active" id="home" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en"><head style="background-color: rgb(255, 0, 0);"> <title>TysonsCorner.com™</title> <link rel="shortcut icon" href="#"> <link href="home.css" rel="stylesheet" type="text/css"> <link href="global.css" rel="stylesheet" type="text/css"> <link href="nav1.css" rel="stylesheet" type="text/css"> </head><body> <div id="container"> <!-- HEADER AREA STARTS HERE --> <div id="content"> <div id="header"> <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="760" height="200" id="Banner(FLASH) - Beta" align="middle"> <param name="allowScriptAccess" value="sameDomain" /> <param name="allowFullScreen" value="false" /> <param name="movie" value="Banner(FLASH) - Beta.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" /> <embed src="Banner(FLASH) - Beta.swf" quality="high" bgcolor="#ffffff" width="760" height="200" name="Banner(FLASH) - Beta" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /> </object> <ul id="primary-nav"> <!-- PRIMARY NAVIGATION (CATEGORIES) STARTS HERE --> <li id="nav-1"><a href="#" title="Tysons Corner Homepage">Tysons Homepage</a> <ul> <li><a href="#" title="Tysons 1 Stores">News</a></li> <li><a href="#" title="Tysons 2 Stores">Events</a></li> <li><a href="#" title="More Tysons Shopping">Contact Us</a></li> <li class="bottom"></li> </ul> </li> <!-- PRIMARY NAVIGATION (BRANDS) STARTS HERE --> <li id="nav-2"><a href="#" title="Tysons Corner Shopping">Tysons Shopping</a> <ul> <li><a href="#" title="Tysons 1 Stores">Tysons I</a></li> <li><a href="#" title="Tysons 2 Stores">Tysons II</a></li> <li><a href="#" title="More Tysons Shopping">More Shopping</a></li> <li class="bottom"></li> </ul> </li> <!-- PRIMARY NAVIGATION (PRODUCTS) STARTS HERE --> <li id="nav-3"><a href="#" title="Tysons Corner Restaurants">Tysons Restaurants</a> <ul> <li><a href="#" title="Cajun Food">Cajun</a></li> <li><a href="#" title="Grilled Food">Grilled</a></li> <li><a href="#" title="Foreign Food">Foreign</a></li> <li><a href="#" title=" Full List Restaurants">Complete List</a></li> <li class="bottom"></li> </ul> <li id="nav-4"><a href="#" title="Tysons Corner Restaurants">Tysons Restaurants</a> <li id="nav-5"><a href="#" title="Tysons Corner Restaurants">Tysons Restaurants</a> <li id="nav-6"><a href="#" title="Tysons Corner Restaurants">Tysons Restaurants</a> <li id="nav-7"><a href="#" title="Tysons Corner Restaurants">Tysons Restaurants</a> </li> </ul> </div> <div id="leftpanel"> <div id="leftpanel-head"> Search </div> <form id="form1" method="post" action=""> <p> <label> <input type="text" name="IDsearch" id="IDsearch" width="150"/> </label> </p> </form> <div id="leftpanel-head"> Events Calendar </div> <div id="leftpanel-head"> Sponsored Ads </div> <script type="text/javascript"><!-- google_ad_client = "pub-8246327012745782"; /* 120x600, created 10/23/08 */ google_ad_slot = "1782998545"; google_ad_width = 120; google_ad_height = 600; //--> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script> </div> <div id="newsroom"> <div id="newsroom-header">News Room</div> </div> <div id="welcome">Test</div> <div id="newsroom"> <script language="javascript" src="http://www.thenewsroom.com//mash/swf/voxant_player.js?a=V3126802&m=669243&w=300&h=290&v=2"></script> </div> </div> </body></html> Demo: http://www.reston.com/Tysons Corner COM Hello, 1st post on this forum. How can I create a three column layout with the left and right div-containers sticking to the left and right sides and then make the middle container stay centered? I would post links to the pages but this forum will not let me. Thanks for the help hello, well im try to make three columns, left,center,right. the left and the right have fixed width,but the center colums should be stretched, so if the left and right each is 200px the center should be the space left in the browser screen in the center. Is it possible to do this using CSS divs? Please this is urgent. Thanks in Adanved Samer It's not letting me post links since I am a new member, so copy paste the link below. (it's an image of what looks wrong in the website) img59.imageshack.us/i/52153657.jpg/ It loads correctly in Firefox and IE8, but the middle column breaks in ie7 and ie8 in compatibility mode. By break I mean the middle column gets shifted to the right side of the middle column and below the right column (while still in the middle column) I have also included the general layout and css below. I have tried changing doc types and a few small things but nothing has even effected the appearance. The website is in a layout like this: html4strict Code: Original - html4strict Code <div id="wrapper1"> <div id="wrapper2"> <div id="maincol"> <div id="leftcol"> </div> <div id="rightcol"> </div> <div id="centercol"> </div> </div> <div id="footer"> </div> </div> </div> <div id="wrapper1"> css Code: Original - css Code #centercol { position:relative; padding:0 200px; min-width: 520px; } #leftcol { position:relative; top:-10px; left:-10px; float:left; width:180px; margin:0 0 -10px 0; padding:10px; z-index:100; } #rightcol { position:relative; top:-10px; right:-10px; float:right; width:180px; margin:0 0 -10px 0; padding:10px; z-index:99; } #maincol { position:relative; margin:0; padding:10px; } #wrapper1 { position:relative; text-align:left; width:100%; min-width: 950px; background:#23415C url("images/side.gif") repeat-y top right; } #wrapper2 { position:relative; text-align:left; width:100%; background:url("images/side.gif") repeat-y top left; } #centercol { Any ideas on how to resolve this problem would be great. I'm looking for a nice cross browser (well, actually I mainly interested in IE8 and ff3) 3 column layout with header and footer where the middle column has a fixed width and the left and right are variable width. I like these: http://matthewjamestaylor.com/blog/perfect-3-column.htm But none have a fixed width center column (could they be modified for a fixed width center col?) Any suggestions? Hello, (please also see attached/uploaded style sheet) I'm puzzled why (in the following code) the TEST #2 table renders as required (i.e. 2 rows in 1 column, all with the same cell WIDTH) but the table in TEST #1 seems to render the table cells (i.e. 2 columns in 1 row) without a common cell WIDTH. How can I get all the cells (there are plenty more!) in table TEST #1 to all be exactly the same width (preferably 85px)? Code: <link rel="stylesheet" type="text/css" href="http://thinet/cgi-bin/thinetStyleSheet.css"> TEST #1 <table class="menu" border=1 CELLPADDING=2> <tr> <td class="pinkButtons"><a title="Treats menu" href='http://thinet/theread/forumdisplay.php?s=&forumid=82'>Treats</a></td> <td class="pinkButtons"><a title="New Starters, Leavers and Transfers" href='http://thinet/theread/forumdisplay.php?s=&forumid=41'>Joiners etc.</a></td> </tr> </table> <P> TEST #2 <table class="menu" border=1 CELLPADDING=2> <tr><td class="pinkButtons"><a title="Treats menu" href='http://thinet/theread/forumdisplay.php?s=&forumid=82'>Treats</a></td></tr> <tr><td class="pinkButtons"><a title="New Starters, Leavers and Transfers" href='http://thinet/theread/forumdisplay.php?s=&forumid=41'>Joiners etc.</a></td></tr> </table> I don't think I've quite grasped the idea of CSS yet?!?! Any help/pointers would be appreciated. Thanks, Andy Hi guys, This is another standard "why won't it work in IE"-post. I'm making a multi-column news-style site (<spam>first link in my signature</spam>), and IE screws up the widths. The layout is basically three .col's which are floated left, and a #menu on the right. Here's the relevant css: Code: #menu { float: left; margin-left: 0%; width: 20%; line-height: 120%; padding: 2%; font-size: larger; } .col { float: left; width: 24%; font-size: 0.8em; } .col ul{ list-style-type: none; padding-left: 0; } .col .story{ background: #F5F8ED; padding: 0 ; margin: 1%; border: 1px solid #71804D; color: #333; text-align: justify; } Here's some example html: Code: <div class="col"> <ul> <li class="story"> <p class="story_title"> story title </p> <div class="story_body"> <p>blah blah</p> </div> <div class="sub"> <p>stuff</p> </div> </li> </ul> </div> <div class="col"> <ul> <li class="story"> <p class="story_title"> story title </p> <div class="story_body"> <p>blah blah</p> </div> <div class="sub"> <p>stuff</p> </div> </li> </ul> </div> <div class="col"> <ul> <li class="story"> <p class="story_title"> story title </p> <div class="story_body"> <p>blah blah</p> </div> <div class="sub"> <p>stuff</p> </div> </li> </ul> </div> <div id="menu"> <div id="menu_title"> <h1> title </h1> </div> <ul id="navbox"> <li> ... </li> </ul> ... etc </div> The problem is that IE renders the .col's very narrowly, and has some major space vertically between them. This means that #menu gets pushed down below the .col's. Can anyone point me in the right direction to fix this width issue? Thanks, Simon I've been designing a template for my phpBB install to make it integrate with my site better, and what I have so far I like, but I noticed one small problem. I'm not sure if it's a bug in mozilla or what the cause is, but at random times my Author details column will take up 100% of the screen with, when it's defined via css to only take up 12%. A simple reload is all that is required to fix it, but it can be quite annoying when it happens. The problem only seems to happen on the post view, which is available he http://kicken.mine.nu:8008/forums/viewtopic.php?t=4 It seems I have more luck getting it to happen if I start clicking around between the Home page and the post view, or from the index to a post view. I havn't had access to any browser other than mozilla to check things in either, so I'm not sure what results will show in other browsers. I am working on the new home page which is based on a template. The left sideColumn is working fine, however I am having a few problems with the mainColumn layout. Here is a static image to show what I want it to look like Here are the problems I am having: 1) The #scroll box is place where I want it in IE but in foxfire it is right up against the left side of the #sideColumn partially hidden. There will be text that scrolls into this box and stops. I haven't started on the part yet - in case that makes a difference. Not my choice, but that is what the bosses want. 2) I want the image centered horizontal within the #mainColumn. Here is what I have for the css: #home img { margin: 5px auto 5px auto; } which I thought would do the trick, but it's not. 3) I want the p text to have a 40px margin on the right and left side like the .large does. Here is what I have for the css: #home p, .large { margin: auto 40px auto 40px; } It works for the .large (Welcome to Vitalograph), but not for the text below it. At one point I had it working, but after addtional changes fixing other problems, now it doesn't and I can't figure out why. Here is the xhtml starting at the 2 column part (wrapper): Code: <!--begin wrapper--> <div id="wrapper"> <!--begin side column --> <div id="sideColumn"> <span class="category">Products</span> <ul> <li><a href="/products/spirometers.html">Spirometers</a></li> <li><a href="/products/clinical_trials.html">Clinical Trials</a></li> <li><a href="/products/asthma_copd.html">Asthma & COPD</a></li> <li><a href="/products/smoking_cessation.html">Smoking Cessation</a></li> <li><a href="/products/resuscitaion.html">Resuscitation</a></li> </ul> <span class="category">Resources</span> <ul> <li><a href="/resources/contact_us.html">Customer Support</a></li> <li><a href="/resources/training_services.html">Training & Services</a></li> <li><a href="/resources/exhibitions.html">Exhibitions</a></li> <li><a href="/resources/newsletters.html">Newsletters</a></li> <li><a href="/resources/downloads.html">Downloads</a></li> <li><a href="/resources/useful_links.html">Useful Links</a></li> <li><a href="/resources/industry_information.html">Industry Information</a></li> <li><a href="/resources/industry_information.html">Sitemap</a></li> </ul> </div> <!--end of side column --> <!--begin main column --> <div id="mainColumn"> <!-- InstanceBeginEditable name="Main_Section" --> <div id="home"> <div id="scroll"><span>scrolling news will go hear and stop</span></div> <img src="/images/boys_bubbles.gif" width="485" height="333" alt="boys and bubbles" /> <span class="large">Welcome to Vitalograph</span> <p>Vitalgraph offers a wide range of spirometers along with other asthma management equipment with over 40 years experience. From simple hand-held units to sophisticated Windows based spirometry systems, we have it all. Check out our full line of respiratory equipment under the product category.</p> <p><a href="/about_us/about_us.html">more about us...</a></p> </div> <!-- InstanceEndEditable --> </div> <!--end of main column --> </div> <!--end of wrapper--> Here is the vitalograph_master.css: Code: body { font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 12px; text-align: center; background-color: #ffffff; color: #515151; margin:0px; padding:10px; } /*page container settings*/ #page { width: 750px; height: 600px; border: 1px solid #5094F9; background-color: #FFFFFF; overflow: hidden; margin: auto; padding: 10px 10px 10px 10px; text-align: left; } /*logo header and tag settings*/ #header { margin: 0; padding-bottom: 5px; width: 450px; height: 36px; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; color: #5094F9; text-align: left; } #header img { vertical-align: -7px; } .tagline { color: #5094F9; font-size: 16; font-style: italic; font-weight: bold; display: inline; clear: both; line-height: 20px; margin-left: 10px; } /*top bar settings*/ #topbar { float: top; height: 20px; background-color: #5094f9; clear: both; padding-left: 10px; text-align: left; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; color: #FFFFFF; font-size: 12px; font-weight: bold; } #topbar a:link, #topbar a:visited { background-color: inherit; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; text-decoration: none; color: #FFFFFF; font-size: 12px; font-weight: bold; } #topbar a:hover, #topbar a:active { background-color: #FFFFFF; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; text-decoration: none; color: #5094F9; font-size: 12px; font-weight: bold; } #topbar ul { list-style: none; margin: 0; padding-top: 2px; } #topbar li { display: inline; margin-right: 160px; } /*Main Section two columns under top section*/ #wrapper{ padding: 10px 10px 10px 0px; width: 100%; height: 100%; } #sideColumn { float:left; width:155px; height: 78%; background-color: #5094F9; padding-top: 50px; padding-left:10px; padding-bottom:10px; pading-right: 10px; margin-right: 10px; text-align: left; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; color: #FFFFFF; font-weight: bold; line-height: 20px; } .category { font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; color: #FFFFFF; font-size: 16px; font-weight: bold; letter-spacing: 5px; } #sideColumn a:link, #sideColumn a:visited { background-color: inherit; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; text-decoration: none; color: #FFFFFF; font-size: 12px; font-weight: bold; } #sideColumn a:hover, #sideColumn a:active { background-color: #FFFFFF; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; text-decoration: none; color: #5094F9; font-size: 12px; font-weight: bold; } #sideColumn ul { list-style: none; padding: 15px 0px 15px 10px; margin: 0px; } #mainColumn { padding: 0px; } /*footer*/ .footer { font-family: "Times New Roman", Times, serif; font-size: 9px; color: #999999; } /*text*/ .large { font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; color: #5094F9; font-size: 18px; font-weight: bold; margin-bottom: 15px; } Here is the home.css: Code: /*home page*/ #home { margin: auto; } #home img { margin: 5px auto 5px auto; } #home p, .large { margin: auto 40px auto 40px; } #home a:link, #home a:visited { background-color: inherit; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; text-decoration: none; color: #5094F9; font-size: 12px; font-weight: bold; } #home a:hover, #home a:active { background-color: inherit; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; text-decoration: none; color: #990099; font-size: 12px; font-weight: bold; } #scroll { width: 560px; padding: 5px; background-color: inherit; border: 1px solid #5094F9; margin-bottom: 5px; } Any help or suggestions are greatly appreciated. |