CSS - Same-height Columns
Doh! Nevermind, I fixed my problem.
Similar TutorialsHello, I'm working now on div layout that contains 3 sections (header, body, footer) in one centered wrapper with border (divs with background imgs). My problem is: - divs that are in fact borders (id="l_outerborder_b" and id="r_outerborder_b") don't stretch when main container (id="body_content_text") grows. Here is a html code: Code: <!--BEGIN TEMPLATE HEADER --> <!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> <link href="template.css" rel="stylesheet" type="text/css" /> <script type="text/javascript" src="template.js" /> </head> <body onload="onloadprocedures()"> <div id="main_container"> <div id="template_header"> <div id="tl_outerborder"></div> <div id="t_outerborder"></div> <div id="tr_outerborder"></div> <div id="l_outerborder_h"></div> <div id="header_content"> <div id="logo"><img src="img/logo.png" alt="" /></div> <div id="slogan"><img src="img/slogan.png" alt="Centrum zdrowia" /></div> </div> <div id="r_outerborder_h"></div> </div> <!-- END TEMPLATE HEADER --> <!-- BEGIN TEMPLATE BODY --> <div id="template_body"> <div id="l_outerborder_b"></div> <div id="body_content"> <div id="body_content_text"> <p>TEST</p> </div> </div> <div id="r_outerborder_b"></div> </div> <!-- END TEMPLATE BODY --> <!-- BEGIN TEMPLATE FOOTER --> <div id="template_footer"> <div style="clear:both"></div> <div id="l_outerborder_f"></div> <div id="footer_content"></div> <div id="l_outerborder_f"></div> <div id="bl_outerborder"></div> <div id="b_outerborder"></div> <div id="br_outerborder"></div> </div> </div> </body> </html> <!-- END TEMPLATE FOOTER --> and CSS: Code: @charset "utf-8"; /* CSS Document */ body { background-color:#FFFFFF; font-family:Tahoma, Verdana, "Times New Roman", Arial; font-size:12px; } a:link {text-decoration: none} /* unvisited link */ a:visited {text-decoration: none} /* visited link */ a:hover {text-decoration: none} /* mouse over link */ a:active {text-decoration: none} /* selected link */ #main_container { position:relative; margin:auto; width:960px; height:auto; } #template_header { float:left; position:relative; width:960px; height:300px; } #header_content { float:left; position:relative; width:900px; height:270px; } #logo { width:310px; height:130px; position:relative; float:left; top:0px; left:0px; } #slogan { width:580px; height:100px; position:relative; float:left; top:0px; left:0px; } #tl_outerborder { float:left; position:relative; background-image:url(img/tl_outerborder.png); width:30px; height:30px; } #t_outerborder { float:left; position:relative; background-image:url(img/t_outerborder.png); width:900px; height:30px; } #tr_outerborder { float:left; position:relative; background-image:url(img/tr_outerborder.png); width:30px; height:30px; } #l_outerborder_h { float:left; position:relative; background-image:url(img/l_outerborder.png); background-repeat:repeat-y; width:30px; height:270px; } #r_outerborder_h { float:right; position:relative; background-image:url(img/r_outerborder.png); background-repeat:repeat-y; width:30px; height:270px; } #body_content { float:left; position:relative; width:900px; overflow:hidden; } #body_content_text { float:left; position:relative; width:600px; margin: auto; overflow:hidden; } #l_outerborder_b { float:left; position:relative; background-image:url(img/l_outerborder.png); background-repeat:repeat-y; width:30px; height:inherit; } #r_outerborder_b { float:right; position:relative; background-image:url(img/r_outerborder.png); background-repeat:repeat-y; width:30px; height:inherit; } #l_outerborder_f { float:left; position:relative; background-image:url(img/l_outerborder.png); background-repeat:repeat-y; width:30px; height:inherit; } #r_outerborder_f { float:right; position:relative; background-image:url(img/r_outerborder.png); background-repeat:repeat-y; width:30px; height:inherit; } #template_body { float:left; position:relative; width:960px; overflow:hidden; } #bl_outerborder { float:left; position:relative; background-image:url(img/bl_outerborder.png); width:30px; height:30px; } #b_outerborder { float:left; position:relative; background-image:url(img/b_outerborder.png); width:900px; height:30px; } #br_outerborder { float:left; position:relative; background-image:url(img/br_outerborder.png); width:30px; height:30px; } Thanks in advance for info how to stretch those doomed divs EDIT: Here is layout concept. URL hTTp://qsrc.pl/layout.jpg Hello all. I have a site with 2 columns. I would like the left column to be the same height as the right column. The right column will always be longer than the left. Here is what I have so far: 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> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <meta name="GENERATOR" content="vi" /> <title>My page </title> <style type="text/css"> * { font-family: verdana, arial, helvetica, sans-serif; margin: 0; padding: 0; } body { background: #0b89b8; margin: 0; padding: 0; } #container { width: 100%; } #header { width: 100%; color: #ffffff; font-size: 2em; padding: 0.5em 0; text-indent: 0.5em; background-color: #00ff00; } /* end #header */ #header p { padding-left: 10%; } #side_menu { background-color: #ff0000; float: left; margin: 0; width: 10%; color: #ffffff; } /* end .side_menu */ #side_menu ul { list-style-type: none; border-top: 1px solid #ffffff; } #side_menu ul li { border-bottom: 1px solid #ffffff; padding: 0.5em 0; text-align: center; } #side_menu ul li a { color: #ffffff; text-decoration: none; } #content { width: 90%; float: left; background: #ffffff; } .content_container { clear: both; padding-bottom: 1em; } .content_header_even, .content_header_odd { width: 100%; background-color: #69bfde; color: #595441; padding: 0.5em 0; text-indent: 1em; } /* end .content_header_even, .content_header_odd */ .content_header_odd { background-color: #b4e8fb; } .content_graph { float: left; padding-right: 1em; } .content_graph_info, .content_info { padding: 1em; margin: 1em; } .content_graph_info { float: left; } </style> </head> <body> <div id="container"> <div id="header"><p>Header</p></div> <div id="side_menu"> <ul> <li><a href="index.php">Home</a></li> </ul> </div> <div id="content"> <div class="content_container"> <p class="content_header_even">Subheader</p> <div class="content_info"> <p>Number: 34906607<br /> Percent: 21.84%<br /> Size: 1.085<br /> Total size : 11.78%</p> </div> <div class="content_graph_container"> <div class="content_graph_info">Text a. </div> <div class="content_graph_info">Text b.</div> </div> </div> </div> </div> </body> </html> Any thoughts? Hi... Not sure how to title this message, but here's the problem: I've got a site that has three columns of variable length text. Each column must have a 2px left border. No problem so far. Under each column of text, I must align a block of links. These blocks must align along the top link. The borders must continue from the top of the text to the bottom of the links. Does this make sense? The problem I have is the border is only solid on the column with the longest amount of text and breaks on the shorter ones. I can get this to work by setting a fixed height for the text, but that doesn't seem like a great solution as it would have to be changed as the text length changes. my CSS: Code: .box {border-left: 2px #CCCCCC solid; width: 254px; float: left; padding-left: 10px; padding-right: 10px;} .txt {font: verdana; font-size: 12px; color: #000000;} .linkscontainer {width: 853px; clear: both;} .linkbox1 {bottom: 0px; position: relative; border-left: 2px #CCCCCC solid; padding-left: 10px; padding-right: 10px; float: left; width: 254px;} .linkbox {bottom: 0px; position: relative; border-left: 2px #CCCCCC solid; padding-left: 10px; padding-right: 10px; float: left; width: 254px;} my html: Code: <html> <head> <link href="test.css" rel="stylesheet" type="text/css"> </head> <body> <div class="box"><div class="txt>">aldfjlaf lj ladfjklafj l flj adlj l <br /> <p>afljlaf lj fljf lf ljf lj dflj asdflj alf <br /> afljlaf lj fljf lf ljf lj dflj asdflj alfafljlaf lj fljf lf ljf lj dflj asdflj alfafljlaf lj fljf lf ljf lj dflj asdflj alfafljlaf lj fljf lf ljf lj dflj asdflj alf</p> </div> </div> <div class="box"><div class="txt>">aldfjlaf lj ladfjklafj l flj adlj l <br /> <p>afljlaf lj fljf lf ljf lj dflj asdflj alf <br /> afljlaf lj fljf lf ljf lj dflj asdflj alfafljlaf lj fljf lf ljf lj dflj asdflj alfafljlaf lj fljf lf ljf lj dflj asdflj alfafljlaf lj fljf lf ljf lj dflj asdflj alf</p> <p>afljlaf lj fljf lf ljf lj dflj asdflj alf <br /> afljlaf lj fljf lf ljf lj dflj asdflj alfafljlaf lj fljf lf ljf lj dflj asdflj alfafljlaf lj fljf lf ljf lj dflj asdflj alfafljlaf lj fljf lf ljf lj dflj asdflj alf</p> <p>afljlaf lj fljf lf ljf lj dflj asdflj alf <br /> afljlaf lj fljf lf ljf lj dflj asdflj alfafljlaf lj fljf lf ljf lj dflj asdflj alfafljlaf lj fljf lf ljf lj dflj asdflj alfafljlaf lj fljf lf ljf lj dflj asdflj alf</p> <p>afljlaf lj fljf lf ljf lj dflj asdflj alf <br /> afljlaf lj fljf lf ljf lj dflj asdflj alfafljlaf lj fljf lf ljf lj dflj asdflj alfafljlaf lj fljf lf ljf lj dflj asdflj alfafljlaf lj fljf lf ljf lj dflj asdflj alf</p> </div> </div> <div class="box"><div class="txt>">aldfjlaf lj ladfjklafj l flj adlj l <br /> <p>afljlaf lj fljf lf ljf lj dflj asdflj alf <br /> afljlaf lj fljf lf ljf lj dflj asdflj alfafljlaf lj fljf lf ljf lj dflj asdflj alfafljlaf lj fljf lf ljf lj dflj asdflj alfafljlaf lj fljf lf ljf lj dflj asdflj alf</p> </div> </div> <div class="linkscontainer"> <div class="linkbox1">link 1<br /> link 2<br /> link 3<br /> link 4<br /> </div> <div class="linkbox">link 1<br /> link 2<br /> link 3<br /> link 4<br /> </div> <div class="linkbox">link 1<br /> link 2<br /> link 3<br /> link 4<br /> </div> </div> </body> </html> Thanks for any help! :grimey Hi, I am trying to better understand how column heights are displayed, and how to create full height columns. On this page http://tapmeister.com/layout_test/index.html, the column which drives the height of the page is <div id="main">, and the left and right columns do not span the entire column height, and the red <div id="content"> shows at the bottom of both side columns. On this page http://tapmeister.com/layout_test/index2.html, I put less stuff in the center <div id="main"> so it wouldn't drive the height of the page. The green <div id="main">, however, did cover the entire column unlike the left and right column on the earlier page. Can anyone help me understand what is going on, and why one column has full height color yet not the other one? Also, what is the best way to make the left and right column have full height color? I know I can apply a repeating background graphic to <div id="content"> which mimics the appearance of the left and right column, however, it would be nice to do differently if possible. My code is listed below (sorry about the ugly colors!) Thanks Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title>Layout Test</title> <style type="text/css"> * {margin: 0; padding: 0;} body {background-color: olive;} #wrapper { width: 100%; background-color: blue; margin: auto; } #main { margin: 0 180px; background-color: green; } #content {background-color: red;} #side1 { width:180px; float:left; background-color:yellow; } #side2 { width: 180px; float:right; background-color:yellow;} #footer { clear:both; background-color:lime; border-top: 10px solid black; } #header {background-color: purple;} .clear { clear:both; } </style> </head> <body id="page_bg"> <div id="wrapper"> <div id="header">My Header</div> <div id="content"> <div id="side2"> <p>Right Column go here. Right Column go here. Right Column go here. Right Column go here. Right Column go here. Right Column go here. Right Column go here. Right Column go here. Right Column go here. Right Column go here. Right Column go here. Right Column go here. Right Column go here. Right Column go here. Right Column go here. Right Column go here. Right Column go here. Right Column go here. Right Column go here. Right Column go here. Right Column go here. Right Column go here.</p> </div> <div id="side1"> <p>Left Column go here. Left Column go here. Left Column go here. Left Column go here. Left Column go here. Left Column go here. Left Column go here. Left Column go here. Left Column go here. Left Column go here. Left Column go here. Left Column go here. Left Column go here. Left Column go here. Left Column go here. Left Column go here. Left Column go here. Left Column go here. Left Column go here. Left Column go here. Left Column go here. Left Column go here. Left Column go here. Left Column go here. Left Column go here.</p> </div> <div id="main"> <p>Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff.</p> <p><img style="margin: 5px; float: left; width: 250px;" src="lady.jpg" alt="" width="250"></p> <p>Some More Stuff. Some More Stuff. Some More Stuff. Some More Stuff. Some More Stuff. Some More Stuff. Some More Stuff. Some More Stuff. Some More Stuff. Some More Stuff. Some More Stuff. Some More Stuff. Some More Stuff. Some More Stuff. Some More Stuff. Some More Stuff. Some More Stuff. Some More Stuff. Some More Stuff. Some More Stuff. Some More Stuff. Some More Stuff.</p> <div class="clear"></div> </div> </div> </div> <div id="footer">My Footer</div> </body> </html> I am baffled by what seems like a simple task which I can't seem to find the solution to. I've two columns (#top_left, #top_right) inside a containing div (#top_container). I want both columns to be the same height (100%). So if the column on the right has more content, the column on the left will stretch to match the same height. If I set a fixed height on the containing div (#top_container), it fixes the issue, since at this point my declaration of height:100% on the two columns actually knows what it is supposed to be 100% of. But then I run into overflow issues if the content goes over fixed height and when I try min-height, the columns fail to stretch once more. Here is my code: Code: <style type="text/css"> #top_container {width:760px;} #top_left {float:left; height:100%; width:200px;} #top_right {float:left; height:100%; width:560px;} </style> <div id="top_container"> <div id="top_left">Content</div> <div id="top_right">Content</div> <br clear="all" /> </div> I've slimmed down the code and cut out non relevant pieces like font styling, colors, and other non pertinent sections. Hi I need these 3 columns http://dmumford.bizhat.com/equalheights.htm to be of equal height regardless of what column has the most text in. Could somone please help me with this, I have looked at Paul OB's 2 col example but I am at a puzzle how to do it with my requirements!! Your help is much appreciated! Hi i want to have a site with 3 columns a header and a footer where the height of the content and both the columns spreads to fill the page even if there is only a few lines of content. Also i wanted to have a margin round the page so that the page doesnt fill the screen horizontal. i cant seem to get it to work correctly does anyone have an example i can look at? cheers Andy Hello, Below is css I am trying to get to work and use as a template for a two column , header, and footer layout. I can get by with css, but an not a designer so can't figure out the exact specifics on how to do this. I've looked at many sites, make examples, javascripts included, but either they are to hard to fit into what I am looking for or just cause me to hit my head against the wall. I'm trying to get the left columns background to fill height 100% to the footer. The content's doesn't need it because the wrapper's background act's as its color. Also, if either column's height changes past the screen's height. I need the footer to move down too. Currently, I tested if the left-column and the main content goes past the screen's height it will just go past the footer. This works beacuse the css I have currently is making sure that the footer is always at the bottom. Code: <html > <head> <title>Untitled Page</title> <style type="text/css"> html { overflow-y: scroll; /* forces firefox scrollbar on */ } body { margin: 0; padding: 0; background: #F2F2F2; font: 100% Helvetica, Arial, sans-serif; height: 100%; } /* text-align: center; is so that the content will float in the center*/ div.wrapper { position: relative; width: 100%; height: 100%; text-align: left; margin-bottom: 42px; } div.header { position: relative; width: 100%; background-color: blue; border-bottom: 1px solid #CCCCCC; font-size: 1.5em; height: 42px; } div.footer { position: absolute; bottom: 0; width: 100%; background-color: blue; border-bottom: 1px solid #CCCCCC; font-size: 1.5em; height: 42px; } div.wrapper .left { width: 215px; float: left; background: yellow; height: 100%; min-height: 100%; } div.wrapper .right { width:auto; margin-left: 215px; } div.wrapper .tabs { background: green; height: 35px; } div.wrapper .mainContent { } </style> </head> <body> <div id="header" class="header">header</div> <div class="wrapper"> <div id="leftColumn" class="left">left content</div> <div class="right"> <div class="tabs">Tabs go here</div> <div class="mainContent">Main content goes here</div> </div> </div> <div id="footer" class="footer">footer</div> </body> </html> Any help would be appreciated thanks in advance. Risso I'm trying to replicate what I had in html tables with css div. The final (I hope) problem is that as I populate cells with data retrieved from a MySQL data base there are columns that want to expand beyond the default height. When that happens, that cell overlaps the next row. If I use min-height, the cell alignment goes haywire because other cells are below the minimum. The workaround is to increase the default height, but that doesn't make me love divs. Is there a solution to this? Here's my code (stripped down--there'e a lot more to the application, and sanitised for anonymity). Thank you. <style type="text/css" media="screen, print, projection"> body, html { margin:0; padding:0; color:#000; background:LightBlue; } #wrap { width:99.5%; margin:0 auto; background:LightBlue; padding:0px 0px 0px 0px; border: none; } #p { float:left; width:72.5%; padding: 0px 0px 0px 0px; border: 3px solid navy; } # li { border-bottom: 1px solid navy; height: 36px; font-size:small; } #p li.header { border-bottom: 1px solid navy; font-weight:bold; font-size:medium; height: 24px; padding:0px 0px 0px 0px; } #p ul { margin:0; padding:0px; list-style:none; } #p p { font-weight:bold; font-size: medium: padding: 0px 0px 0px 0px; } #title { border-bottom: 1px solid navy; width:100%; } #button { float:left; border-bottom: 1px solid navy; border-right: 1px solid navy; width:10%; } #pt { float:left; border-bottom: 1px solid navy; border-right: 1px solid navy; width:20%; } #c { float:left; border-bottom: 1px solid navy; border-right: 1px solid navy; width:30%; } #ex { float:left; border-bottom: 1px solid navy; border-right: 1px solid navy; width:19%; } #az { float:left; border-bottom: 1px solid navy; border-right: 1px solid navy; width:9%; } #ep { float:left; border-bottom: 1px solid navy; width:11%; } </style> </head> <body> <?php // code to connect to mysql and do do some other stuff goes here $cl=field_already_retrieved_from db; echo "<div id=wrap>"; //wrapper for entire page (the real application does a lot more than this section $result = mysql_query //sql select statment goes here $num_rows = mysql_num_rows($result); echo "<div id='p'>"; //wrapper for p's echo "<div id='title'>"; echo "<ul><li class=header>Lines</li></ul>"; echo "</div>"; //end title while($row = mysql_fetch_array($result)) { $p=$row['p']; $v=$row['V']; echo "<form action='detail.php' method='post'> "; echo "<div id='button'>"; //button to display line detail echo "<ul><li>"; echo "<input type='submit' class='btn' name='line' value ='Detail'><input type='hidden' name='p' value ='$p'><input type='hidden' name='v' value ='$v'><input type='hidden' name='cl' value ='$cl'>"; echo "</li></ul>"; echo "</div>"; //end button echo "</form>"; echo "<div id='pt'>"; echo "<ul><li>"; echo $row['pt']; echo "</li></ul>"; echo "</div>"; //end pt echo "<div id='c'>"; echo "<ul><li>"; echo $row['c'] . "/" . $row['PN']; echo "</li></ul>"; echo "</div>";//end c echo "<div id='ex'>"; echo "<ul><li>"; echo $row['Ex']; echo "</li></ul>"; echo "</div>"; //end ex echo "<div id='az'>"; echo "<ul><li>"; echo $row['az']; echo "</li></ul>"; echo "</div>"; //end az echo "<div id='ep'>"; echo "<ul><li>"; echo $row['ep']; echo "</li></ul>"; echo "</div>"; //end ep echo "</form>"; } // end while (select lines from database) echo "</div>"; //end p--wrap for lines echo "</div>"; //end wrap--entire page mysql_close($con); ?> </body> </html> Hey, I have two columns on a site I'm working on, which are a liquid height, this works fine, the page scales the overall page height to contain all off the content. The thing is, I want column 1 to dictate the height of the page, and for column 2 to match that height and add scroll bars if needed. So far I have: Code: #wrapper { width:975px; background-image: url("../Images/main_background.jpg"); } #left_column { width:625px; float:left; padding:0px 25px 0px 25px; } #right_column { width:250px; float:right; padding:0px 25px 0px 25px; } I experimented with adding overflow:auto;, overflow:scroll; and height:inherit; to the right column, but it still stretches to contain the content in the right_column. Any ideas? Thanks guys. 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. Hello, im trying to make Fixed width 3 columns (each column have fixed width) layout 100% height with header and footer. -Well I see alot of examples around the web, but i dont see complete one and im really tired of searching, i made the Fixed width 3 comlumns layout, left and right are absolute position, and center is relative to the header -the problem is that all columns dont fill the whole height of the browser windows, the footer doesnot work good. so the whole thing is missed up, so please show 100% working example of what i need. Thanks in Advanced Samer Hi all, I am trying to automate everything on my test website and I have one more angle to cover. In effect, I want to adjust the line-height property (which I can do) based on the number of files within a specific folder (PHP and already done). The more files in the folder, the lower the line-height value must be. This is to ensure if I copy additional files into the folder, then the navigation menu (which is PHP reading files in this particular folder) will alter the CSS line-height property accordingly to ensure it can never exceed a certain height. Sounds wierd? go to www.re3.org.uk (next to the RE3 image, I have a list of hyperlinks which are obtained from files within the folder) My problem, when adjusting the CSS property (which is set as cm in *.css file) in javascript, it doesn't correspond correctly, the line-height property in javascript doesn't appear to be work in cm but some other measurement. Does anyone know how to change what unit of measurement Javascript works in? Or does anyone know what unit of measurement javascript uses when adjusting line-height / line-width values? I want to create a mini-algorithm that works out the appropriate line-height based on the image height (got that already) and the number of files in the folder (got that too) so the menu automatically adjusts to fit. Whew! Hello Just recently I had an idea for a page I wanted to make, the design is basically a 3-column layout with no traditional header or footer, the height of all three columns should run the length of the window/page height the left and rightmost column would have a fixed width or a width in em, the center column width should fill the space in between. If the content is short all columns should extend to the height of the page window, but if the content in any of the columns is longer than the window height they should all extend to reach the bottom of the page and accommodate the content length In my first attempt things didn't go so well, results varied wildly across browsers so I decided to start from scratch bit by bit Bellow is the point at which I reach consistent but undesired behaviour, I have validated and tested the code in Firefox 3/Pale Moon, Internet Explorer 8, Chromium 9, and Opera 11 I would like the end result to work in the above browsers as well as IE7 if possible I should point out now that im not interested in using faux-columns, the layout should not require images, I also wish to have absolute-positioned elements in the columns some time later 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"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Three Columns</title> <style type="text/css"> *, html, body { margin: 0; padding: 0; font-size: 100%; } html, body { width: 100%; height: 100%; } #maincontainer { position: relative; height: 100%; background: #eee; } #left { position: absolute; top: 0px; left: 0px; width: 200px; background: #fbb; height: 100%; } #mid { position: relative; margin: 0 200px 0 200px; background: #efe; height: 100%; } #right { position: absolute; top: 0px; right: 0px; width: 200px; background: #bbf; height: 100%; } </style> </head> <body> <div id="maincontainer"> <div id="left"> left start<br /> left<br /> left<br /> left<br /> left<br /> left<br /> left<br /> left<br /> left<br /> left<br /> left<br /> left<br /> left<br /> left<br /> left end<br /> </div> <div id="mid"> mid start<br /> mid<br /> mid<br /> mid<br /> mid<br /> mid<br /> mid end<br /> </div> <div id="right"> right start<br /> right<br /> right<br /> right<br /> right<br /> right<br /> right<br /> right<br /> right<br /> right<br /> right<br /> right<br /> right<br /> right<br /> right<br /> right<br /> right<br /> right<br /> right<br /> right<br /> right<br /> right<br /> right end<br /> </div> </div> </body> </html> In the above example it works as long as the content within the columns is shorter than the window height, but if you re-size the window so that the text in the right or left column goes beyond the page, and then scroll to the bottom, the columns do not extend to the bottom of the page so there is a large gap where the content overflows beyond the column What I would like to do from this point is make the columns extend to the bottom of the page when this happens, but I'm not sure how best to proceed I also have a version of the above code which uses floated left and right columns instead of absolute positioned ones, would it be better to work from that? or does it not really matter Thanks in advance I've never done much CSS work, but I know this has to be an easy fix. Each DIV appears to be 10px higher when viewed in IE. I want them to be 8px high and they end up being 18px high. In Firefox, Netscape, and Opera it works fine. Anyone mind correcting this imbarrassing little problem? 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" > <head> <title>IE 10px Padding Problem</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <style type="text/css"> body { margin:0px; } #container { position:relative; margin:auto; width:730px; } #header { height:110px; } .textualtop { border:1px solid #000000; height:8px; } .textualbottom { border:1px solid #000000; height:8px; } </style> </head> <body> <div id="container"> <div id="header"></div> <div class="textualtop"></div> <div class="textualbottom"></div> <div class="textualtop"></div> <div class="textualbottom"></div> <p>Notice how in IE6 each DIV is 10px higher then in FF. Why is it doing this?</p> </div> </body> </html> It seem that everytime I added the image tag, the div'x area get bigger in IE but not in Mozilla/Firefox browser. So, I thought by added the "margin-bottom:-360px;" to the div would fix it but it had an opposite effect. Meaning it worked in IE but Mozilla show a vertical scrollbar. So, does anyone know how can I make the <img> overlap one another without being stacked on one after another in height for IE if I take out the "margin-bottom: -360px;"? Thanks... Code: div.divBox1 { width: 286px; height: 359px; float: left; } div.divClearFloat { clear: both; height: 0px; /* For IE Stupidity (it added some spaces after clearing the float) */ font-size: 1pt; /* For IE Stupidity (minimum height only work with current font-size somewhere) */ } div.divDottedLineAdvertisementSeperator1 { width: 575px; height: 3px; background-color: #ff0000; font-size: 1pt; /* For IE Stupidity (minimum height only work with current font-size somewhere) */ } Code: <div class="divBox1"> <div style="margin-bottom:-360px;"> <img src="images/doctor.jpg" style="position:relative;top:0px;left:0px;z-index:2;"> <img src="images/we_help.jpg" style="position:relative;top:-360px;left:0px;z-index:1;"> </div> </div> <div class="divClearFloat"></div> <div class="divDottedLineAdvertisementSeperator1"></div> Hello everybody! I have been having a big problem with my webpage for a long time now and hope I can find an answer to my problem with your help. I want a div that contains the content of my pages (which varies in length depending on the individual page) to stretch the length of my page, but it only stretches the length of the window. Here's the HTML and CSS: HTML (I only included the very basic structure): <html> <body> <div class="container"> <div id="content"> <div id="..."></div> <div id="..."></div> <div id="..."></div> <div id="..."></div> </div> </div> </body> </html>` CSS: html, body { height: 100%; font-family: Arial; font-size: 10px; color: #000000; background: #FFF url(../../images/body.png) no-repeat center 40px; margin: 0; position: relative;} .container { height: 100%; width: 960px; margin-right: auto; margin-left: auto; position: relative;} #content { width: 939px; min-height: 100%; position: relative; top: 210px; left: 6px; box-shadow: 0px 0px 8px #666; -moz-box-shadow: 0px 0px 8px #666; -webkit-box-shadow: 0px 0px 8px #666; background-color: #FFF;} I tried to set the content div to overflow: auto, but that includes a scroll bar for the content div that I do not want. It does, however, create the desired effect of the shadow and background of the #content div all the way to the end of the page. Am I missing anything? I thought min-height would work, but it doesn't! It only stretches the content div to page height and everything else is overflow, but without the content div's background color and shadow. Does anybody maybe see where the problem lies? Thank you so much in advance for your help. If you look at the bottom of the page at www.res-technologies_DOT_com/index.php?jos_change_template=restech2 in both IE and FF, you will see that it looks fine in IE, but in FF the page length is extended by exactly the height of the header image at the top of the page. Trying to figure out what's causing this is driving me nuts! Can anyone help? thx dh I am having a problem trying to get one column match the height of another. Within a large DIV box, I created two columns separated by about 20 px. I floated one to the left, then pushed one over to the right. Both boxes will expand depending on the amount of content, but I would like them to match the same height. The boxes will be used throughout the entire website, so it would not make sense to create a background image to try and trick it into being the same height.. or actually specifying the height. Is there any way to tell the left box to be the same height as the right box?? I tried to link to my site but it won't let a new member link to a website. |