CSS - Consistent Div Heights
See:
http://www.mandgweb.net/css_help/ I am trying to get the 'divs' of the 3 columns of content (A, B, C) to expand to the height of the tallest column (in this case 'A') while the height of the main container (blue border) expands/contracts as necessary to accommodate the tallest column. The main effect I am trying to achieve it to get the vertical rules between the columns to be the same height (i.e. the height of the tallest column). Easier said then done..? Thanks in advance. Similar TutorialsMy web site (URL address blocked: See forum rules) is causing me problems with CSS since I have reworked it. If you look at my web pages in Internet Explorer they look perfect. In Firefox when loading some of the pages the top logo blinks and takes a few seconds to load. In Opera some pages move slightly to the right. I know the problem is related to the length of the center div but I have no idea how to fix this unless I make the small centers longer. Also my previous version of this site just used one image. Logo.gif was in the background. I have put Logo.gif in the header and have used GREEN.jpg as my background now. MY CSS body { background-image: url(../images/GREEN.jpg); } div.container { position: relative; margin: 0 auto; width: 746px; height: 840px; } #header { height: 100px; width: 746px; background-image: url(../images/Logo.gif); background-repeat: no-repeat; background-position: 50% 0%; } #nav { position: absolute; top: 110px; left: 55px; height: 20px; width: 640px; } #left { position: absolute; top: 160px; left: 0px; width: 124px; } #center { position: absolute; top: 160px; left: 130px; width: 441px; height: auto; border: solid; } /* right div at this time has been made invisible. Maybe later add Flash content*/ #right { position: absolute; top: 160px; left: 600px; width: 130px; height: 100px; } /* this div belongs on photo pages and shows the alphabet on the right.Takes place of right div */ #navalpha { position: absolute; top: 160px; left: 600px; width: 100px; height: 130px; font-family: "Courier New", Courier, monospace; border: solid; } /* Start of Top Menu*/ ul { list-style: none; margin: 0; padding: 0; font-size: .95em; } ul li { float: left; margin: 0; padding: 0; } ul li a { color: #777; display: block; text-align: center; text-decoration: none; width: auto; padding: 3px 5px 3px 5px; border-color: #191970; border-width: 1px 1px 1px 0; border-style: solid; } ul li.first a { border-width: 1px; } ul li a:hover { background-color: Fuchsia; color: Yellow; } /* end of Top Menu*/ /* start of side Menu*/ ul#navlist { width: 102px; padding: 0px; margin: 0px; border-left: thin solid Black; font-size: .95em; float: left; } ul#navlist li { list-style: none; margin: 0px; border: 0px; } ul#navlist li a { color: #777; width: 102px; padding: 2px 8px 2px 8px; border-color: #191970; border-width: 0px 1px 1px 0; border-style: solid; text-decoration: none; text-align: left; } ul#navlist li.topfirst a { border-top: 1px solid Black; } ul#navlist li a:link { color: Blue; } ul#navlist li a:hover { border-color: #191970; color: Red; background: Yellow; } ul#navlist li a:visited { color: Blue; } /* end of side Menu*/ p { text-align: left; margin: 0 10px 0 10px; } h1 { font-size: 1.05em; color: Navy; text-decoration: underline; font-style: italic; font-weight: bold; font-variant: small-caps; padding: 0px 0 6px 19px; border-bottom: 1px dashed navy; background: url(cube.gif) no-repeat 0 2px; margin: 0 10px 0 10px; } h2 { font-size: 1em; color: Navy; text-decoration: underline; font-style: italic; font-weight: bold; font-variant: small-caps; margin: 0 10px 0 10px; } h3 { font-size: .9em; color: Navy; text-decoration: underline; font-style: italic; font-weight: bold; font-variant: small-caps; margin: 0 10px 0 10px; } a:link { color: #0000FF; text-decoration: none; } a:visited { color: #0000FF; text-decoration: none; } a:hover { color: Red; text-decoration: none; } a:active { text-decoration: none; } /* ....................thumbnail determines how the small photos look */ .thumbnail { float: left; width: 83px; height: 115px; border: 1px solid #999; margin: 0px 15px 5px 0; padding: 5px; } /* .................thumbnailUnitBoard determines how the photos look on Unit Board page */ .thumbnailUnitBoard { float: left; width: 220px; margin: 0px 15px 15px 0; padding: 5px; } I'm playing around with web development after quite a lengthy break. I wrote the home page out by hand and had attempted to validate, fixed the errors and repeated until it validated at w3.org. When I copied the code from the first page and removed the right side of the table ( it was 3 columns on the main page but I only wanted 2 columns for the "template page" ). When viewing the template page in IE the table is off center ( all the way to the left ) and the links have unwarranted line spaces between them. I can understand removing a column might affect the alignment of a table ( or at least, this is not what I'm worried about so much ) but the alterations to the navigation pane are baffling. Specifically, because the nav pane is inserted by the same php script on both the working, and dysfunctional page. The css is also the same as they are coded to pull from the specified url copy and pasted from one doc to the other as opposed to mistakenly using a css in a different directory than the working one. The working page is: Code: <html> <head> <title> Under Construction </title> <link rel="stylesheet" type="text/css" href="css/pcss.css" id="css" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> </head> <body> <table class="main"> <tr class="header"> <th class="left"><div id="img"></div></th> <th class="center"><h1 class="MainHeading">Brendan Walton</h1></th> <th class="right"> </th> </tr> <tr class="body"> <td> <div id="navMenu"> <ul class="navlist"> <li> <div class="navhead" onclick='IsOpen(0)'>Literature</div> <ul class="navlist" id="sm0" style="display:block;"> <li><a href="" class="navlink">Guides</a></li> <li><a href="" class="navlink">Web Reference</a></li> <li><a href="" class="navlink">Desktop Reference</a></li> <li><a href="" class="navlink">External Reference</a></li> </ul> </li> <li> <div class="navhead" onclick='IsOpen(1)'>Fun and Random</div> <ul class="navlist" id="sm1" style="display:none;"> <li><a href="" class="navlink">Videos</a></li> <li><a href="" class="navlink">Images</a></li> <li><a href="" class="navlink">Music</a></li> <li><a href="" class="navlink">Random Page</a></li> </ul> </li> <li> <div class="navhead" onclick="IsOpen(2)">Code Base</div> <ul class="navlist" id="sm2" style="display:none;"> <li><a href="code_base_sample2.html" class="navlink">Java</a></li> <li><a href="code_base_sample2.html" class="navlink">C++</a></li> <li><a href="code_base_sample2.html" class="navlink">PHP</a></li> <li><a href="code_base_sample2.html" class="navlink">JavaScript</a></li> </ul> </li> <li><div class="navhead" onclick="IsOpen(3)">General</div> <ul class="navlist" id="sm3" style="display:none;"> <li><a href="" class="navlink">About Us</a></li> <li><a href="" class="navlink">Don't Like the Look?</a></li> <li><a href="" class="navlink">Community</a></li> <li><a href="" class="navlink">Site Map</a></li> </ul> </li> </ul> </div> <div class="navhead" style="height:150px;"><img src="images/stats.jpg" alt="TempStats" /></div> <script type="text/javascript" src="javascript/menuwork.js"></script> </td> <td> <h4 class="heading">Coming Soon!!</h4> <hr class="pagebreak" /> <p class="cblock"> This website will eventually have content, for now, just enjoy the pretty colors and the fancy, interactive menu to the left...</p> <h4 class="heading">Update: April 6, 2010</h4> <hr class="pagebreak" /> <p class="cblock"> I have changed the navigation to the left to reflect the content the site will eventually house. Additionally I have begun styling how the codebase will eventually display it's information. To see a sample of the code output simply click any of the codebase links to the left.</p> <p class="cblock"> On a personal note, it has recently come to my attention that Dom's birthday was actually the second of April, not the fourth. I apologize for the tardy wishes. </p> <h4 class="heading">Update: April 4, 2010</h4> <hr class="pagebreak" /> <p class="cblock"> Still working on the style for the website, It's coming along, albeit slowly... Also, even though you're never going to see this, Happy birthday Dom 8-)</p> </td> <td><img src="images/Brendan.jpg" alt="Brendan" id="portrait" /> <hr style="width:150px;" /> <p class="iblock"> "Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live." - Martin Golding"</p> <hr style="width:150px;" /> <a href="aboutus.php"> About Us </a> </td> </tr> <tr > <td> </td> <td> <!-- footer removed for containing urls --> </td> <td> </td> </tr> </table> </body> </html> The dysfunctional page is: Code: <!-- XHTML 1.1 --> <!-- Document Start --> <html> <!-- Head --> <head> <!-- Title --> <title> </title> <!-- Style Sheet --> <link rel="stylesheet" type="text/css" href="css/pcss.css" id="css" /> <!-- Charset UTF-8 --> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <!-- PHP Includes --> </head> <!-- End Includes --> <!-- Body --> <body> <!-- Main Table --> <table class="main"> <!-- First Row - Header --> <tr class="header"> <!-- Start Banner --> <th class="left"><div id="img"></div></th> <th class="center"><h1 class="MainHeading">Brendan Walton</h1></th> <!-- End Banner --> </tr> <!-- End First Row --> <!-- Second Row - Content --> <tr class="body"> <td> <div id="navMenu"> <ul class="navlist"> <li> <div class="navhead" onclick='IsOpen(0)'>Literature</div> <ul class="navlist" id="sm0" style="display:block;"> <li><a href="" class="navlink">Guides</a></li> <li><a href="" class="navlink">Web Reference</a></li> <li><a href="" class="navlink">Desktop Reference</a></li> <li><a href="" class="navlink">External Reference</a></li> </ul> </li> <li> <div class="navhead" onclick='IsOpen(1)'>Fun and Random</div> <ul class="navlist" id="sm1" style="display:none;"> <li><a href="" class="navlink">Videos</a></li> <li><a href="" class="navlink">Images</a></li> <li><a href="" class="navlink">Music</a></li> <li><a href="" class="navlink">Random Page</a></li> </ul> </li> <li> <div class="navhead" onclick="IsOpen(2)">Code Base</div> <ul class="navlist" id="sm2" style="display:none;"> <li><a href="code_base_sample2.html" class="navlink">Java</a></li> <li><a href="code_base_sample2.html" class="navlink">C++</a></li> <li><a href="code_base_sample2.html" class="navlink">PHP</a></li> <li><a href="code_base_sample2.html" class="navlink">JavaScript</a></li> </ul> </li> <li><div class="navhead" onclick="IsOpen(3)">General</div> <ul class="navlist" id="sm3" style="display:none;"> <li><a href="" class="navlink">About Us</a></li> <li><a href="" class="navlink">Don't Like the Look?</a></li> <li><a href="" class="navlink">Community</a></li> <li><a href="" class="navlink">Site Map</a></li> </ul> </li> </ul> </div> <div class="navhead" style="height:150px;"><img src="images/stats.jpg" alt="TempStats" /></div> <script type="text/javascript" src="javascript/menuwork.js"></script> </td> <td> </td> </tr> <!-- End Second Row --> <!-- Third Row - Footer --> <tr> <td> </td> <td> <!-- footer removed for containing urls --> </td> </tr> <!-- End Third Row --> </table> <!-- End Table --> </body> <!-- End Body --> </html> <!-- End Doc --> The css is: Code: body { color:#333333; background-color:#FFFFFF; margin:0px; padding:0px; } hr.pagebreak { width:450px; color:#550072; } .subHeading { color:#8A00B8; font-size:18px; } ul.navlist { display:inline; list-style-type:none; margin:0px; padding:0px; } a.navlink:link { color:#FFFFFF; background-color:#550072; display:block; text-align:right; text-decoration:none; font-weight:bold; margin:0px; padding-right:2px; } a.navlink:visited { color:#FFFFFF; background-color:#550072; display:block; text-align:right; text-decoration:none; font-weight:bold; margin:0px; padding-right:2px; } a.navlink:hover { color:#FFFFFF; background-color:#8A00B8; text-decoration:none; margin:0px; padding-right:2px; } tr { vertical-align:top; } table { margin-left:auto; margin-right:auto; margin-bottom:0; margin-top:0; } table.main { background-color:#FFFFFF; } th.left { width:150px; } th.center { width:500px; } th.right { width:150px; } a.navhead:link { display:block; text-decoration:none; text-align:left; color:#550072; font-weight:bold; border-style:groove; margin:0px; padding:0px; } a.navhead:visited { display:block; text-decoration:none; text-align:left; color:#550072; font-weight:bold; border-style:groove; margin:0px; padding:0px; } div.navhead { display:block; text-decoration:none; text-align:left; color:#550072; font-weight:bold; border-style:groove; margin:0px; padding:0px; } h4.heading { display:block; margin:0px; padding-right:30px; color:#550072; text-indent:15px; text-align:right; font-size:24px; } img { display:block; margin:0; padding:0; } p.cblock { display:block; text-indent:15px; padding-left:10px; width:475px; } p.fblock { display:block; text-indent:15px; padding-left:10px; width:475px; text-align:center; } .footer { text-align:center; } #navMenu { height:300px; } h1.MainHeading { font-size:50px; color:#550072; text-align:left; } #img { background-image:url("../images/purple-150x150-clear.jpg"); background-repeat:no-repeat; height:150px; width:150px; } img.cssscriptimg { display:inline; } #portrait { width:150px; } p.iblock { display:block; text-indent:15px; padding-left:10px; width:150px; } The navigation script is below: PHP Code: <?php // This is a simple script to insert the navigation pane into every page function echoNav () { // color changer //echo "<img class=\"cssscriptimg\" src=\"images/purple.jpg\" alt=\"purple\" onclick=\"LoadCss(\"purple\")\" />"; //echo "<img class=\"cssscriptimg\" src=\"images/red.jpg\" alt=\"red\" onclick=\"LoadCss(\"red\")\ />"; //echo "<img class=\"cssscriptimg\" src=\"images/green.jpg\" alt=\"green\" onclick=\"LoadCss(\"green\")\" />"; // navMenu devision echo "<div id=\"navMenu\">\n"; // Section List echo "<ul class=\"navlist\">\n"; // First section echo "<li>\n"; echo "<div class=\"navhead\" onclick='IsOpen(0)'>Literature</div>\n"; // First link list echo "<ul class=\"navlist\" id=\"sm0\" style=\"display:block;\">\n"; echo "<li><a href=\"\" class=\"navlink\">Guides</a></li>\n"; echo "<li><a href=\"\" class=\"navlink\">Web Reference</a></li>\n"; echo "<li><a href=\"\" class=\"navlink\">Desktop Reference</a></li>\n"; echo "<li><a href=\"\" class=\"navlink\">External Reference</a></li>\n"; echo "</ul>\n"; // End first section echo "</li>\n"; // Second Section echo "<li>\n"; echo "<div class=\"navhead\" onclick='IsOpen(1)'>Fun and Random</div>\n"; echo "<ul class=\"navlist\" id=\"sm1\" style=\"display:none;\">\n"; echo "<li><a href=\"\" class=\"navlink\">Videos</a></li>\n"; echo "<li><a href=\"\" class=\"navlink\">Images</a></li>\n"; echo "<li><a href=\"\" class=\"navlink\">Music</a></li>\n"; echo "<li><a href=\"\" class=\"navlink\">Random Page</a></li>\n"; echo "</ul>\n"; echo "</li>\n"; // End Second Section // Third Section echo "<li>\n"; echo "<div class=\"navhead\" onclick=\"IsOpen(2)\">Code Base</div>\n"; echo "<ul class=\"navlist\" id=\"sm2\" style=\"display:none;\">\n"; echo "<li><a href=\"code_base_sample2.html\" class=\"navlink\">Java</a></li>\n"; echo "<li><a href=\"code_base_sample2.html\" class=\"navlink\">C++</a></li>\n"; echo "<li><a href=\"code_base_sample2.html\" class=\"navlink\">PHP</a></li>\n"; echo "<li><a href=\"code_base_sample2.html\" class=\"navlink\">JavaScript</a></li>\n"; echo "</ul>\n"; echo "</li>\n"; // End Third Section // Fourth Section echo "<li>"; echo "<div class=\"navhead\" onclick=\"IsOpen(3)\">General</div>\n"; echo "<ul class=\"navlist\" id=\"sm3\" style=\"display:none;\">\n"; echo "<li><a href=\"\" class=\"navlink\">About Us</a></li>\n"; echo "<li><a href=\"\" class=\"navlink\">Don't Like the Look?</a></li>\n"; echo "<li><a href=\"\" class=\"navlink\">Community</a></li>\n"; echo "<li><a href=\"\" class=\"navlink\">Site Map</a></li>\n"; echo "</ul>\n"; echo "</li>\n"; // End Fourth Section // End Section List echo "</ul>\n"; // End navMenu echo "</div>\n"; // Stats echo "<div class=\"navhead\" style=\"height:150px;\"><img src=\"images/stats.jpg\" alt=\"TempStats\" /></div>\n"; // Scripts echo "<script type=\"text/javascript\" src=\"javascript/menuwork.js\"></script>\n"; // echo "<script type=\"text/javascript\" src=\"javascript/LoadCss.js\"></script>\n"; } ?> Note: I apologize for only pasting the HTML, this is the HTML as seen by IE after scripts have been run. I would have put links but I am a new user and that appears to be restricted. Removed direct URL access to the javascripts, images, and doctypes, as a result of being a new user as well, in the actual source they are accessed by a URL to ensure that it is compatible no matter which directory the functions are called within. That being said, the javascript was never a problem, even with the display issue, the javascript functioned as expected. Any help would be very appreciated 8-) Hi... I have got a problem with a page I am working on. I have got at stylesheet for my site. By this stylesheet I want my page to look the same nearly always. But unfortunately the page moves around and the width of my <div> tags changes from time to time. This image is of the page as it should look: http://www.student.dtu.dk/~s011606/width2.jpg And this image is as it often looks like: http://www.student.dtu.dk/~s011606/width1.jpg I would like the page to look like the first image at all times.. But i cant find the problem in the stylesheet.. My default page looks like this: Code: <TABLE width="100%"> <TR> <TD valign="top"> <div id="centermainbox"> <?php if (!isset($page)) { include "frontpage/frontpage.php"; } else { include($page . "/" . $page . "_page.php"); } ?> </div> </TD> <?PHP if ($_SESSION['inst_msg']) { echo '<TD width="285" valign="top">'; echo "<div id=\"instantbox\">"; echo '<IFRAME src="instantmsg/inst_msg_page.php" HEIGHT="100%" WIDTH="100%" frameborder="0"></IFRAME>'; //$db_connection->db_stop(); echo "</div>"; echo "</TD>"; } else { echo "<td width=\"20%\"></td>"; } ?> </TR></TABLE> The relevant informations in the stylesheet looks like this: Code: #centerbox { position: relative; top:1px; left: 20em; width: 75%; padding : 0px 0px 0px 0px; } #centermainbox { position: relative; top:0px; left: 0em; height: auto; width: auto; min-height: 490px; background: white; border:1px solid #8CACBB; padding : 10px 10px 10px 10px; overflow: auto; } #instantbox { position: relative; top:0px; min-height: 490px; height: 490px; min-width: 285px; max-width: 285px; width: 285px; background: white; border:1px solid #8CACBB; padding : 10px 10px 10px 10px; overflow: auto; } I hope there is someone who can help me.. Kind regards Jens... A left floating text box that text wraps around the top, right and bottom is not rendering at the same size in all browsers (IE and Firefox are my main test platforms). The page was going pretty well, thanks to some help I have already received, but I hit a snag on this. Please take a look at the test page below. TEST PAGE The relevant style code follows: Code: .textboxleft { background: #3E5C92; font: normal 0.8em/140% arial, helvetica, sans-serif; margin: 10px; width: 160px; border: 1px solid #E4E7F5; float: left; overflow: hidden; padding: 0.5em; } .textboxleft p { color: #000000; } ul li { color: #E0E0F6; font: normal 0.9em/135% tahoma, arial, helvetica, sans-serif; } Of course, you can also look at the complete source code and download the css file for more information. I would be happy to provide any additional information. If there is something I can alter in the CSS to make the box 160px wide (or whatever I decide on) in all browsers, please let me know. I am very new at this and have only gotten this far with the help of people like you. Thank you, Grump PS: you will also notice another thread concerning the bulleted list problem you see. It bumps into the text box and doesn't look good. Please excuse any redundancy, but these are 2 different problems, I think. I'm working on a very simple layout for a site right now, where there are two repeated images on either side of the content in div's, and obviously everything else in between. The problems I'm having a - getting the image div's to extend to the end of the page no matter what the height (currently they only fill the browser when the page is loaded, if the page goes further the images do not repeat) - getting the content div to take up all available space, so the footer div will always be at the bottom of the page, even if it is not vertically scrollable. Here's the code: Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>The Website</title> <style type="text/css"> html { height: 100%; } body { background-image: url(bg.jpg); height: 100%; margin: 0; min-width: 1024px; text-align:center; } #wrapper { margin: auto; align: center; height: 100%; width: 1024px; } #left { background-image: url(sidebar-left.png); height: 100%; width: 32px; float:left; } #center { background-color: #AAAAAA; height: 100%; width: 960px; float:left; } #right { background-image: url(sidebar-right.png); height: 100%; width: 32px; float: right; } #banner { background-image: url(banner-pattern.jpg); height: 100px; } #buttons { background-color: #FFFFFF; height: 20px; border: 1px solid black; } #content { border: 1px solid black; height: 100%; } #footer { background-color: #FFFFFF; height: 80px; border: 1px solid black; } </style> </head> <body> <div id="wrapper"> <div id="left"></div> <div id="center"> <div id="banner"></div> <div id="buttons"></div> <div id="content"></div> <div id="footer"></div> </div> <div id="right"></div> </div> </body> </html> I don't have it hosted anywhere right now but I think it's a relatively simple problem. I did search around for solutions for a while, but I couldn't find a fix. Yes, I am new to CSS / website design / not using tables to do things Hi, I'm new to the forum and very new to CSS, so please excuse my ignorance or any stupid fundamental mistakes I have made. I have almost got what I need to work, but my wrapper and the leftshade and rightshade div heights will not work with the height of the page. If I set them to a preset pixel height, they're fine, but when I set them to auto they disappear. I need them to be able to scroll to whatever the length of my content is going to be. I could really use some advice on how to sort this. Many thanks in advance. Code: <!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>Heading</title> <style type="text/css"> <!-- body { margin-right: auto; margin-left: auto; text-align: center; margin-top: 0px; margin-bottom: 0px; background-color: #C2FFC1; } #wrapper { width:960px; height:auto; margin-right: auto; margin-left: auto; } #middle { position:relative; top:0px; width:940px; height:auto; float: left; background-color: #FFFFFF; } #leftshade { top:0px; width:10px; height:600px; float: left; background-image: url(images/shadeleft.png); background-repeat: repeat-y; } #rightshade { top:0px; width:10px; height:600px; float: left; position: relative; background-image: url(images/shaderight.png); background-repeat: repeat-y; } #banner { width:940px; height:150px; background-color: #FFFFFF; } #navbar { width:940px; height:50px; background-color: #6DC072; border-top-width: thin; border-bottom-width: thin; border-top-style: solid; border-right-style: none; border-bottom-style: solid; border-left-style: none; border-top-color: #666666; border-bottom-color: #666666; text-align: left; vertical-align: middle; } } #centre { position:relative; width:580px; height:257px; padding: 10px; float: left; } #content { width:940px; height:auto; background-color: #FFFFFF; } #contentleft { position:relative; width:150px; height:auto; float: left; padding: 10px; } #contentmiddle { position:relative; width:580px; height:auto; padding: 10px; float: left; } #contentright { position:relative; width:150px; height:auto; float: right; padding: 10px; } --> </style> </head> <body> <div id="wrapper"> <div id="leftshade"></div> <div id="middle"> <div id="banner"></div> <div id="navbar"></div> <div id="content"> <div id="contentleft"> <p>f</p> </div> <div id="contentmiddle"> <p> </p> </div> <div id="contentright"> <p> </p> </div> </div> </div> <div id="rightshade"></div> </div> </div> </body> </html> HI, I have the following tables: PHP Code: <table class="middle" cellspacing="0" cellpadding="0" border="1"> <tr> <td style="height: 1px;"> <img border="0" src="images/spacer.gif" width="1" height="1"> </td> <td align="left" valign="top"> <p class="customHeading">aaaa</p> </td> <td valign="top"> <p align="right"> <a class="importantLink" href="">aaa</a> | <a class="importantLink" href="">aaa</a> | <a class="importantLink" href="">aaa</a> </p> </td> </tr> <tr> <td colspan="3" valign="top"> <form action="aaa.php" method="post" onsubmit="return validate(this);"> <table class="content" cellspacing="0" cellpadding="0" border="0"> <tr> <td align="left">aaa:</td> <td><input type="text" name="issueNumber" size="22" class="formField"> </td> <td><a href="#"> <input type="submit" value="SEARCH" class="formButton" onmouseover="this.className='formButtonHover';" onmouseout="this.className='formButton';" > </a> </td> </tr> </table> </form> </td> </tr> </table> They use the following CSS classes: PHP Code: .middle { width: 760px; height: 360px; background-color: #FFFFFF; } .content { background-color: #FFFFFF; font: 13px Arial, sans-serif; padding: 2px; margin-left: auto; margin-right: auto; } My issues is this. In IE the row of the first table (where the hrefs are) expands to a seemingly arbitrary height, beyond the size of the text contained within it. In Netscape the row is only as high as the text contained within it. I want it to act the same in IE as it does in Netscape. Never thought I'd say that.. =) Any ideas? Hi, I have a dotted border that seperates my navigation bar from my content area. My question is since I had to remove a set height from my CSS IDs how to I get the border to extend all the way from the top blue bar all the way to my footer? It looks okay on the main page because it uses up all of the space but when you go to a page where the content does not take up the same height as the nav area the border does not extend all the way down. The border is currently set as border-right for the main content. If i set it to border-left for the nav bar it will display correctly on the shorter pages but only cover the nav bar for my longer pages. Any ideas on how to fix this problem? Its the last one! My site is located he http://www.venturingvortex.org the css is located he http://www.venturingvortex.org/Style/Master.css Hello, I have been writing a web page as a project for a course using XHTML. I have tested it with several browsers, including IE, Netscape, and Opera and validated its source code and CSS Style sheet. The site works at 1024 X 768 resolution. My problem is that if I minimize the window or change the screen resolution size every div element gets switched around and the display is destroyed. The page is currently located at http://student.flvs.net/html/millety/mod8/index2.htm . Please tell me how to fix this. The links on the page do not work as they should, so only look at the oage I have linked to. I would like the color behing the navigation to run in a vertical band all the way to the bottom of the page. The footer is supposed to be all the way at the bottom and the main text's background color should not appear under it, which is part of my current problem. Thank you in advance for your help. Hi.. another question for the CSS mastas out there. I have a table taht I have applied a class to: PHP Code: <table class="middle" cellspacing="0" cellpadding="0" border="0"> <tr> <td> <img border="0" src="images/spacer.gif" width="1" height="1"> </td> <td align="left"> <p class="customHeading">aaaa</p> </td> <td> <p align="right"> <a class="importantLink" href="">aaa</a> | <a class="importantLink" href="">aaa</a> | <a class="importantLink" href="">aaa</a> </p> </td> </tr> <tr> <td colspan="3" valign="top"> <table class="content" cellspacing="0" cellpadding="0" border="0"> <tr> <td align="left">aaa:</td> <td><input type="text" name="aaa" size="22" class="formField"> </td> <td><a href="#"> <input type="submit" value="SEARCH" class="formButton"> </a> </td> </tr> </table> </td></tr></table> .middle { width: 760px; height: 360px; background-color: #FFFFFF; } .content { background-color: #FFFFFF; font: 13px Arial, sans-serif; padding: 2px; margin-left: auto; margin-right: auto; } The issue I'm having is that I can't seem to control the height of the outside tables first row. It seems to just take on a size depending on how I set the height in the element. Can I not place a height tag in the <td>'s for that row to set it at a fixed height? Hi, I have this border on the right hand side of my table and i was wondering, how do i reduce its height as i don't want it going right from the top to the bottom? border-top: 1px solid #6593B8; any help is appriciated, Thanks Well I've run into a few more snags and after all of my atempts to learn this **** on my own I failed and need help... keep this in mind... My only table named capsule is defined like so: index.php Code: <body> <table class="capsule"> default.php Code: .capsule { border-collapse:seperate; border-spacing:0; position:absolute; left:0; top:0; bottom:0; right:0; width:100%; height:100%; } My "biggest" concern I'm trying to make a site that is at least supported on all resolutions supported by my monitor, 800x600 to 1600x1200. I also plan to include 640x480 but my monitor doesn't go that low so I'm hoping it looks nice, as if anything could look nice at 640x480, when the other resolutions are tested. I found a few solutions to this but unfortunatly none of them worked for strict xhtml. Most of them used the tagline height attribute and tagline margin attributes. I substituted the tagline html for CSS like this: Code: body { margin:0; } This didn't work, you might have guessed that... I know with an object and static sizes, like something defined in px, can use the overflow scroll property. But that's static sizes and limited in resizing features. Here is the code I got my ideas from: [code] <BODY leftmargin="0" rightmargin="0" topmargin="0" bottommargin="0" marginwidth="0" marginheight="0" link="#000000" alink="#CDCDCD" vlink="000000"> <TABLE border="0" cellpadding="0" cellspacing="0" height="100%"> [code] I looked for an alternate to margin-height and margin-width with no luck. Another "issue" spacing in cells. I hate IE, yet another problem that is ONLY visible in IE, not opera no mozilla, firefox, galleon, konquor. Wha thappens is, gayness spacing. I have the following CSS and this worked in every browser but IE 6.0. Unfortunately, since MS is a big part of the computer world, I can't just NOT support it. See .capsule above. According to w3schools this should work from IE5+. One more "thing" ...a little off topic, just a lil' I always thought that Opera used the IE engine but Opera, IMO is better than IE. It just, works. All this for well you know...ugly sites suck... Any responses to any of these topics or to further expand on the are more than welcome!!! PS When I came to this site it said 404 NOT FOUND. I tried again it worked. I then tried NEW THREAD and again the same thing. I tried again and it worked. I said "F* this ****" cleared cache etc and tried again. Still the same problem. Any new place I vist from this visit on, I think, is going to be a pain, all of my old bookmarks will have to be updated somehow...I don't know what this is. Any button I hit, preview post, ad links, save changes, submit thread, etc.. all do the same thing. Some admin might be interested in this... Once I do it once it doesn't happen for that action anymore. Greetings Not sure about the best way to go about this. I have an Unordered List that has a set height for the List Items. Like so: Code: #left ul { padding: 0px; list-style-type: none; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; } #left ul li { text-align: center; float: left; margin-right: 20px; height: 200px; margin-bottom: 20px; } This works fine for most of the pages, but there is one where I really need the height of the <li>'s to be 350px. I tried just adding a class like Code: .comics { height: 350px; } I tried adding this to the <li> Code: <li class="comics"><a href="#"><img src="images/comics/thumbnails/HeldvsHeldin3_sm.jpg" alt="" width="250" height="350"> </a></li> and also just a <span> Code: <li><span class="comics"><a href="#"><img src="images/comics/thumbnails/HeldvsHeldin3_sm.jpg" alt="" width="250" height="350"> </a></span></li> but it still kept the 200px height. Do I need to make a whole new <li> code or am I missing something? Hey, I was wondering how you set the height of a div so that the div will cover the full height of the page. currently i have: .navigationDiv{ position: absolute; width: 19%; height: 100%; } This fills the whole visible part of the document as it was loaded but once you start scrolling down its not filled anymore. how to fix this? thanks in advance? Hi! I'm playing around with style sheets, mainly because I have a tabular layout at the moment and everyone keeps telling me how evil tables are, so i tought being as i haunt devshed, i should use the advice and before my site gets too big, change it! Finding it quite difficult to start with, but making good progress! And I have the following so far... PHP Code: h1 {font-size: 1.4em; font-family: Times, "Times New Roman", serif; font-weight: bold; text-align: left;} h2 {font-size: 1.3em; font-family: Times, "Times New Roman", serif; font-weight: bold; text-align: left;} h3 {font-size: 1.2em; font-family: Times, "Times New Roman", serif; font-weight: bold; text-align: left;} h4 {font-size: 1.1em; font-family: Times, "Times New Roman", serif; font-weight: bold; text-align: left;} h5 {font-size: 1em; font-family: Times, "Times New Roman", serif; font-weight: bold; text-align: left;} a:link {color: #ffffff; text-decoration: none;} a:hover {color: #dedbcb; text-decoration: underline;} a:visited { color: #ffffff; text-decoration: none;} body {margin: 0; padding: 0; font-family: sans-serif; font-size: .7em; line-height: 1.4em} div#header {padding: 2%; text-align: center; background-color: #0e2e3b; color: #ffffff; margin-bottom: 2px; border-bottom: solid #ffffff 1px} div#footer {padding: 2%; text-align: center; clear: both; background-color: #0e2e3b; border-top: solid #ffffff 1px} div#maincontent {padding: 2%; text-align: justify; margin-left: 150px; background-color: #0e2e3b; color: #ffffff; margin-bottom: 2px; border-right: solid #ffffff 1px; border-left: solid #ffffff 1px} div#leftcolumn {padding: 2%; float: left; text-align: right; background-color: #0e2e3b; color: #ffffff; width: 150px;} div#rightcolumn {padding: 2%; float: right; text-align: right; background-color: #0e2e3b; color: #ffffff; width: 10px;} My question is, the rightcolumn is really just for layout, its not going to contain anything. What I need is the right column to equal the height of the left column all the time, so the layout looks right. Could someone point me in the correct direction? Charlie IE seems to have a lot of trouble with percentage based heights. In certain circumstances they seem to be okay, other times they seem be completely ignored. Pixel based DIV heights seem to work, but I don't know if it is just the circumstance or what not. Does anyone know what the actual "rules" are about this as it applies to IE? Hello, I'm relatively new to using CSS as the foundation of a site, as i've only ever built sites for family/work etc using tables. I have used it previously for styling and so on, but not as intensively as i now am. It's great, but a couple of issues are giving me a headache - the fun of web design, hey?... I'm experiencing two problems, and have spent a lot of time describing them (with examples and images) on the following page - fnb4wd.com.au/4x4wh/help/help.htm - not wanting to clutter up the forum with my explanations and too many images. The first is to do with the 100% height trick - my "wrapper" div is not expanding with my "content" div - but i do not believe faux columns are possible for my design (if someone proves me wrong, great!) as i don't have two full height columns, but one content column and a vertical menu div... The second issues is with a Horizontal menu i am using as main navigation. In both FireFox & Chrome, the menu shifts down so the text links are unreadable unless hovered over. In IE, it's positioned as i want (with Comp View Settings turned on for IE8). So, if anyone could shed come light on my problems, i'd love to hear some ideas. The full explanation, complete with working examples and images (as well as my code) can be seen at fnb4wd.com.au/4x4wh/help/help.htm. Thanks in advance, Azerus85 Hello everyone, Ive been trying to reconstruct a web design from a photoshop design and it has bars going down the side of a center container where the content is, the problem im having is when the text and such in the content 'rule' goes over one line, prior to what i thought would happen, only the content 'rule' scales to the amount of text and the container rule does nothing. Is there a way to make the container scale with the content and have the bars scale with the container...? Heres the css and the html Code: #container { margin-left: auto; margin-right: auto; top: 0; width: 875px; margin-top: -8px; padding: 0; overflow: visible; background: #FFFFFF; } #secondbar { margin-left: 102px; margin-right: auto; width: 40px; top: 0; position: absolute; background: #4D220F; } #bar { margin-left: 6px; margin-right: auto; width: 96px; top: 0; position: absolute; /*[empty]height:;*/ background: #E3C98E; } #thirdbar { margin-left: 123px; margin-right: auto; width: 21px; top: 0; position: absolute; background: #7F8FA6; } #content { margin-left: 154px; margin-right: auto; top: 0; width: 709px; position: absolute; background: #FFFFFF; } Code: <head> <title>Test</title> <link rel="stylesheet" type="text/css" href= "styles.css"> </head> <body bgcolor="f4f1ea"> <div id="container"><div id="bar"> </div><div id="secondbar"> </div><div id="thirdbar"> </div> <div id="content"> </div></div> </body> Thanks for any help, sorry if its a bit confusing Xidus Hi, and thanks for reading. I have a design that I put together in Photoshop without thinking of what I would have to do to make it a reality and then got the okay on it. That was a mistake. I'm now stuck with this. Which is totally fine, but then you hit this, and everything sucks. The problem is he Code: #body {position:absolute; left:101px; top:13px; width:624px; height:100%;} #content {border:solid 3px #000000; background-color:#FFFFFF; width:613px; padding-left:80px;} #content is inside #body. I also have a transparent image I use as a placeholder with a height of 360px, which seems to only really work if I have height:100% in #content. The problem with that is then any page where the content is over 360px, like in the first link, overlaps #content even though it's all inside content as <p>, <table>, <form>, etc. My question is, what can I do to fix this? If there's nothing that will work on CSS 2, then I could always just add some extra lines at the bottom of pages with little content. Problem is, this is going to eventually be backed by a CM used by totally clueless people who won't understand the purpose of the extra lines even if I explained it. Any ideas? Thanks in advance, -colin |