CSS - Css Element Height Problem (auto)
I wish to set a container to have auto height... meaning the height of the container is defined by it's contents. I have had this working in many other designs... but this one baffles me.
(Problem is only in good browsers mozila/firebird) Here it is with the height of #main @ auto (attached) Here it is with the height of #main @ 600px (attached) Here is the HTML code: Code: <!-- Code --> <!-- Document --> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <title>Ben Gunn</title> <link rel="stylesheet" href="index.css" /> </head> <body> <div id="main"> <img src="images/default_header.gif" id="header" height="120" width="749"/> <div id="content"> <div class="left"> <ul id="nav"> <li><a href="#">News</a></li> <li><a href="#">Music</a></li> <li><a href="#">Media</a></li> <li><a href="#">Bio</a></li> <li><a href="#">Contact</a></li> </ul> </div> <div class="right"> </div> </div> </div> <br /><br /> </body> </html> And here is the code for the CSS: Code: body { margin: 0; padding: 0; background-color: #666666; } #header{ margin-left: 2px; } #main { position: relative; width: 756px; height: 600px; left: 50%; margin-left: -355px; margin-top: 20px; background-image:url("images/background-bezel.gif"); background-repeat: repeat-y; padding: 0px; padding-bottom: 20px; /*border: black 1px solid;*/ } #content{ padding: 10px; } .left{ float: left; width: 30%; } .right{ float: right; width: 60%; } #nav{ list-style: none; margin: 0; padding: 0; border: none; padding-left: 10px; font: 10pt Verdana, Geneva, Arial, Helvetica, sans-serif; color: white; font-weight: lighter; } #nav li { background-color: #8B0000; border-bottom: 1px solid #CCCCCC; margin: 0; padding: 1px 0 2px 0; } #nav li a { display: block; text-decoration: none; width: 100%; color: white; padding-left: 5px; } html>body #nav li a { width: auto; } #nav li a:hover { background-color: #191970; color: #fff; } Please notify me of the moronic mistakes I am making... thanks. Similar TutorialsI am building a custom form control that behaves more or less like a <select> menu. For the dropdown portion of the menu, I need to set a max-height. If the dropdown contains enough options to go beyond the max-height a vertical scrollbar should appear. 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=iso-8859-1" /> <title>Custom Auto-Complete</title> <script type="text/javascript"> <!-- function initPage() { } --> </script> <style type="text/css"> <!-- body { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 76%; } input { width: 200px; background: #f4f4f4; border: 1px solid #999; font-size: .9em; /* */ } .clearfix { display: inline-block; } .clearfix:after { content:"."; display:block; height:0; clear:both; visibility:hidden; } .cAutoCompleteCtl { position: relative; /* border: 3px solid red; */ } .cAutoCompleteCtl input { margin: 0 5px 0 0; display: block; float: left; } .cAutoCompleteCtl a.dwnarrow { width: 15px; height: 15px; border: 1px solid #999; background: url(images/downarrow.gif) no-repeat; background-position: center center; background-color: #efefef; float: left; display: block; font-size: 1px; text-decoration: none; } .cAutoCompleteCtl .acCtlDropdwn { position: absolute; top: 20px; left: 0px; z-index: 100; visibility: visible; min-width: 300px; max-width: 600px; height: auto; max-height: 200px; background: #fff; padding: 5px; border: 1px solid #999; overflow: auto; /* width: 400px; */ } * html .cAutoCompleteCtl .acCtlDropdwn { width: expression( this.scrollWidth < 330 ? "300px" : ( this.scrollWidth > 620 ? "600px" : "auto" ) ); height: expression( this.scrollHeight < 20 ? "200px" : ( this.scrollHeight > 301 ? "300px" : "auto" ) ); } .cAutoCompleteCtl .acCtlDropdwn a { white-space: nowrap; display: block; text-decoration: none; padding: 2px 5px; color: #000; border: 1px solid #fff; } .cAutoCompleteCtl .acCtlDropdwn a.lastOption { } .cAutoCompleteCtl .acCtlDropdwn a:hover { background: #f5f5f5; border: 1px solid #b3b3b3; } --> </style> </head> <body onload="initPage();"> <div class="cAutoCompleteCtl clearfix"> <input type="text" /><a href="" class="dwnarrow"> </a> <div class="acCtlDropdwn"> <!--<a href="#">options here options here options here options here options here options here options here options here options here options here options here</a>--> <a href="#">options here</a> <a href="">Boulder Logic</a> <a href="">A Rference With A Different Name</a> <a href="">A Rference With A Different Name</a> <a href="">A Rference With A Different Name</a> <a href="">A Rference With A Different Name</a> <a href="">A Rference With A Different Name</a> <a href="">A Rference With A Different Name</a> <a href="">A Rference With A Different Name</a> <a href="">A Rference With A Different Name</a> <a href="">A Rference With A Different Name</a> <a href="">A Rference With A Different Name</a> <a href="">A Rference With A Different Name</a> <a href="">A Rference With A Different Name</a> <a href="">A Rference With A Different Name</a> <a href="">A Rference With A Different Name</a> <a href="">A Rference With A Different Name</a> <a href="">A Rference With A Different Name</a> <a href="">A Rference With A Different Name</a> <a href="">A Rference With A Different Name</a> <a href="">A Rference With A Different Name</a> <a href="">A Rference With A Different Name</a> <a href="">A Rference With A Different Name</a> <a href="">A Rference With A Different Name</a> <a href="">A Rference With A Different Name</a> <a href="">A Rference With A Different Name</a> <a href="">A Rference With A Different Name</a> <a href="">A Rference With A Different Name</a> <a href="">A Rference With A Different Name</a> <a href="">A Rference With A Different Name</a> <a href="">A Rference With A Different Name</a> <a href="">A Rference With A Different Name</a> <a href="">A Rference With A Different Name</a> <a href="">A Rference With A Different Name</a> </div> </div> </body> </html> I'm seeing some unexpected behaviour ihn Firefox. When the page is loaded for the 1st time, the height of the dropdown portion of the menu is only large enough to see 1 option and no scrollbars are displayed. If I hit refresh (without holding the Shift key), the menu's height goes to its max-height and displays as expected. The only property I could find that has any effect on this behaviour is overflow. If I remove it all together or set it to scroll, it displays at the correct height. Unfortunately, neither of these are an option since they will not produce the desired scrolling behaviour. Can anyone see where I'm going wrong? I'm pretty new to this so I'm not 100% sure what I'm doing yet. However, I've created a test page to show you guys the rendering issue that I'm experiencing. The page renders how I want it to in Firefox, Flock and Chrome. It renders incorrectly in IE8 (which is a required browser that this needs to be supported in). Here is a link to the test page cm-rosestate.mine.nu/test.aspx and the css is /MyStyle.css My suspicion is that it's a problem with the css and/or the doctype. However, I just don't know enough about this to know how to troubleshoot it. Any help or insight will be appreciated. I seem to recall that CSS1 or 2 had a property that could be set to specify the height of a text input box or check box or radio button, but it's been a while since I've done it and I can't find it in my notes or find the search terms that will turn up what I'm looking for, or even the page that I did it on. I thought
Code: <input type="text" style="{ height: Xpx; }"> would do it, but it doesn't. Here's some of my code ... xhtml Code: Original - xhtml Code <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "https://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=ISO-8859-1"></meta> <meta http-equiv="Content-Language" content="en-US"></meta> <style type="text/css"> body { margin: 0px; padding: 0px; font: normal normal normal 12px/14px Veranda,Arial,sans-serif } div { } table { width: 100%; border: none } tr { } td { } .right { text-align: right } ul { margin: 0px; padding: 0px; list-style: none } li { padding-left: 25px } label { } input { font: normal normal normal 9px/11px Arial, Veranda, sans-serif; } .textrightinput { text-align: right; height: 18px } .textleftinput { text-align: left; height: 18px } .buttoninput { height: 18px } </style> <title>Donations</title> </head> <body> <!-- Begin Body Table --> <div> <form id="form" action="https://my.domain.com/donate/" method="post"> <fieldset> <legend>Select the project(s) you wish to support.</legend> <input type="hidden" name="cc" value="checkEntries" /> <table> <tr> <td> <ul> <li><label><input type="checkbox" name="projects[]" value="Doin-it-Myself Hydropower Project" checked="checked" />Doin-it-Myself Hydropower Project</label></li> <li><label><input type="checkbox" name="projects[]" value="Joe Cell Development Project" checked="checked" />Joe Cell Development Project</label></li> <li><label><input type="checkbox" name="projects[]" value="Site Maintenance/Upkeep" checked="checked" />Site Maintenance/Upkeep</label></li> <li><label><input type="checkbox" name="projects[]" value="extra" onclick="javascript:enable('form','other')" /> Other: <input id="text" class="textleftinput" type="text" name="projects[]" value="blah blah" disabled="disabled" /></label></li> <li class="center"><label> Amount: $<input id="text" class="textrightinput" type="text" name="amount" value="25" title="Enter the dollar value you intend to donate." /></label></li> </ul> </td> </tr> <tr> <td class="right" colspan="2"> <input class="buttoninput" type="submit" value="Next⇒" title="Click to verify that we correctly received your entries." /> </td> </tr> </table> </fieldset> </form> </div> <!-- End Body Table --> </body> </html> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "https://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=ISO-8859-1"></meta> <meta http-equiv="Content-Language" content="en-US"></meta> <style type="text/css"> body { margin: 0px; padding: 0px; font: normal normal normal 12px/14px Veranda,Arial,sans-serif } div { } table { width: 100%; border: none } tr { } td { } .right { text-align: right } ul { margin: 0px; padding: 0px; list-style: none } li { padding-left: 25px } label { } input { font: normal normal normal 9px/11px Arial, Veranda, sans-serif; } .textrightinput { text-align: right; height: 18px } .textleftinput { text-align: left; height: 18px } .buttoninput { height: 18px } </style> <title>Donations</title> </head> <body> <!-- Begin Body Table --> <div> <form id="form" action="https://my.domain.com/donate/" method="post"> <fieldset> <legend>Select the project(s) you wish to support.</legend> <input type="hidden" name="cc" value="checkEntries" /> <table> <tr> <td> <ul> <li><label><input type="checkbox" name="projects[]" value="Doin-it-Myself Hydropower Project" checked="checked" />Doin-it-Myself Hydropower Project</label></li> <li><label><input type="checkbox" name="projects[]" value="Joe Cell Development Project" checked="checked" />Joe Cell Development Project</label></li> <li><label><input type="checkbox" name="projects[]" value="Site Maintenance/Upkeep" checked="checked" />Site Maintenance/Upkeep</label></li> <li><label><input type="checkbox" name="projects[]" value="extra" onclick="javascript:enable('form','other')" /> Other: <input id="text" class="textleftinput" type="text" name="projects[]" value="blah blah" disabled="disabled" /></label></li> <li class="center"><label> Amount: $<input id="text" class="textrightinput" type="text" name="amount" value="25" title="Enter the dollar value you intend to donate." /></label></li> </ul> </td> </tr> <tr> <td class="right" colspan="2"> <input class="buttoninput" type="submit" value="Next⇒" title="Click to verify that we correctly received your entries." /> </td> </tr> </table> </fieldset> </form> </div> <!-- End Body Table --> </body> </html> Can you see what I'm doing wrong? screenshot.bmp Hello! I'm hoping you guys could help me with a small problem.. I'm trying to get my images to keep their aspect ratio with this CSS, #photo-inner img { margin: 0 0 10px; padding: 0 0 10px; max-width: 718px; width: expression(this.width > 718 ? 718: true); height: auto; } Works perfectly in Firefox, Safari.. But IE don't want to play along. Any tips? // T Hi Guys I am currently trying to make a website, the problem is that its not quite working..... I have a main div that holds everything inside it but when i set its height to auto its not staying the correct length. Basically i want this main div to stretch out longer every time new content is added (dynamically). Why is it not staying as long as the content thats contained within it? Anyone know why this is happening and how i can fix it ? Help?! Code: #main { height: auto; width:868px; margin-left:15px; margin-top:15px; background-color:#FFFFFF; margin-bottom:3px; } Thanks Hi guys, Before I go on, here's the page I'm referring to: http://student-consolidation-loans.co.uk/newsite3/ In IE 6 on the PC the layout is how I want it, however, skip over to the mac and it doesn't look correct in any browser (safari, IE, firefox...) The problem is I've given one of the DIVs (the one that contains the white and black diagonally striped background) an auto height so it stretches to fit all the content, but while IE 6 is picking up on this none of the mac browsers are. Is there a workaround? thanks! Let me start by saying I'm new to CSS and web developement in general. So I'm probably missing something simple. I have an ASP page that has a treeview along the left, and a tab control to the right of it. I put everything in div's, and floated left the treeview and tab div's. I put a div around it all to have a border. I set that div to be height:auto (or 100%), and it doesn't expand at all. I can give it a true height, but that's not really what I want. Also, it I resize my page really small (manually), the tab div drops below the tree div. Here is the code. Can anyone point me in the right direction to accomplish what I'm trying to do? Thanks! Code: <%@ Page Language="vb" AutoEventWireup="false" MasterPageFile="~/App/Master/AmcMaster.Master" CodeBehind="CoreWorkload.aspx.vb" Inherits="Core.UI.CoreWorkload" title="Core Workload" %> <%@ MasterType VirtualPath="~/App/Master/AmcMaster.Master" %> <%@ Register tagprefix="controls" src="~/Controls/CoreWorkloadTv.ascx" tagname="CoreWorkloadTree" %> <asp:Content ID="Content1" ContentPlaceHolderID="AuthContent" runat="server"> <asp:UpdatePanel ID="CoreWorkloadUpdatePanel" UpdateMode="Conditional" runat="server"> <ContentTemplate> <div id="coreWorkloadDiv" style="border-style: solid; border-width: thin; height: auto; padding-top: 5px;"> <div id="treeDiv" style="width:150px; height: 100%; overflow:auto; float:left;" > <controls:CoreWorkloadTree id="wbsTree" runat="server"></controls:CoreWorkloadTree> </div> <div id="tabDiv" style="padding: 10px; float: left; width: 80%; height: 100%; "> <ajaxtoolkit:TabContainer runat="server" ID="Tabs" Height="600px" Width="100%" > <ajaxToolkit:TabPanel runat="Server" ID="SummaryPanel" HeaderText="Summary"> <ContentTemplate> <br />WBS Summary data goes here... </ContentTemplate> </ajaxToolkit:TabPanel> <ajaxToolkit:TabPanel runat="Server" ID="DetailPanel" HeaderText="Detail"> <ContentTemplate> <br />WBS Detail data goes here... </ContentTemplate> </ajaxToolkit:TabPanel> </ajaxtoolkit:TabContainer> </div> </div> </ContentTemplate> </asp:UpdatePanel> </asp:Content> Hi all, I have come back to designing websites after a long time and I am having problems making the height auto work in firefox. The css code: Code: div.t2_container{ width:679px; height:auto; text-align:left; padding-top:10px; padding-bottom:10px; background:#e7e7e9; } div.t2_col1{ float: left; width:470px; height:auto; display: inline; clear:both; background:#FFFFCC; } div.t2_col2{ float: right; width:199px; height:auto; display: inline; background:#CCFFFF; } and the html: Code: <body> <div class="t2_container"> <div class="t2_col1"><p>text text</p><p>text text</p><p>text text</p></div> <div class="t2_col2"><p>text text</p><p>text text</p><p>text text</p><p>text text</p></div> </div> </body> IE recognizes the height = auto on the container div and resizes so that the inner divs are contained within the grey bounding box of the container. However firefox does not recognize this and the 2 inner divs fall outside the container which is left hanging thin at the top. Does anyone know a fix for this pls? Thanx So, I have a div that is acting as a container. I contains a background image and colour that goes beyond the image should the image not be big enough for certain resolutions. Anyways inside this div container are 2 more divs, one with a set height that holds images, and another one below the first one that holds text. Now this text changes on a regular basis, but I don't really want to have to adjust the height of the container div everytime I add more text or take away text, I want it to automatically adjust the height as it needs to. I tried setting the height property to auto, but that didn't do anything. Just wondering if someone knows a way to do this? I'm trying to create an image-navigation system using the popular css sprites technique. However, on the very first image (doesn't occur with any images following), IE6 (and below) increases the height of that image. Here's a very simple code. There are no other codes or elements to interfere with this issue, and yet, it is still present. Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <title>Title Goes Here</title> <style type="text/css"> .nav_top{background:url('http://i185.photobucket.com/albums/x14/mMaNgOeZz/nav-1.gif'); float:left; } #img1{background-position: 0px 0px; width: 1200px; height: 14px; } #img2{background-position: 0 -14px; width: 101px; height: 34px;} </style> </head> <body> <a class="nav_top" id="img1"></a> <a class="nav_top" id="img2"></a> </body> </html> Any help would be appreciated to no end. Thanks in advance. I have a wrapper div 700px wide that is currently set to the following: Code: div.wrapper { width: 700px; height: auto; background-image: url(../local/images/content.gif); background-repeat: repeat; background-attachment: scroll; background-position: top left; text-align: left; padding: 0.05in; position: absolute; left: 50%; margin-left: -350px; border: 2px #000000 ridge; } It renders fine in IE, FF, and Opera. Since the height of the content varies, I am trying to accomplish a minimal fixed height of 700px OR larger if the content is longer than 700 px. Any ideas? Hi to all, and thanks a million in advance for help. I have developed a simple online cms and everything is setup correctly but i am stuck at one place. I am unable to make width to 100% when b div is empty i mean a div = 50% width, b div = 50% width, how set it up that when a div is empty then b div goes to 100%width and when b div is empty then a div is 100% width. i hope got my question. because currently i have set in this way. wrapper div = 980px width, a div = 50% width, b div = 50% width, wrapper div end so when a div is empty then b div is still present and that area is empty it destroy the whole look. thanks arsslan Hello, I've about given up.. I've always used mostly tables, with div 's here and there. I've been trying to build some completely CSS3 / HTML5 pages.. might as well be ready for the next step.. anyways.. Both w3.org validators (css3 and html5) validate the pages, but they are not right. I thought the body could be used as the parent container.. and if not i've tried this with a 'wrapper' div also .. with an image of bottom, problem area. . So, why wont the parent container, set to 'auto' or '100%' 'grow' beyond 1760 pixels? I can set it to 2000px or what ever, but then I have to change it anytime page content changes. FYI. I use mozilla nightly, Aurora browsers on all my openSuSE systems running KDE.. Don't know if it will look diff on another system.. don't really care, but .. Thank you in advance, Landis. I am trying to layout some content into rows using DIVs. It works fine until I get to the row of 'cells'. If I don't set the height of the container div ("transaction"), it doesn't show the white background. If I make the background of the inner DIVs white, it looks blocky (not solid white bg). I tried float options but that didn't seem to help. Any thoughts? Code: <style type="text/css"> <!-- @charset "utf-8"; body { margin-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; font-family: Geneva, Arial, Helvetica, sans-serif; } #contents { position:relative; margin:0 auto; width:700px; text-align:left; } #contents .payPeriod { padding: 8px; background-color:#E8EAFF; margin: 8px; } #contents .dateBlock { font-size: 70%; background-color:#E0E0E0; margin-right: -8px; margin-left: -8px; padding-top: 0; padding-right: 8px; padding-bottom: 0; padding-left: 8px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: none; border-bottom-style: none; border-left-style: none; border-top-color: #999999; border-right-color: #999999; border-bottom-color: #999999; border-left-color: #999999; } #contents .transaction { font-size: 160%; background-color:#FFFFFF; margin-right: -8px; margin-left: -8px; padding-top: 0; padding-right: 8px; padding-bottom: 0; padding-left: 8px; float: none; clear: both; height: 80px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: none; border-bottom-style: none; border-left-style: none; border-top-color: #84C0FD; border-right-color: #84C0FD; border-bottom-color: #84C0FD; border-left-color: #84C0FD; } #contents .details { width: 70%; float: left; } #contents .amount { font-size: 120%; float: left; width: 20%; display: inline; text-align: right; } #contents .posted { float: right; width: 7%; display: inline; text-align: right; } #contents .group { font-size: 150%; float: left; display: inline; } #contents .description { font-size: 70%; float: left; display: inline; clear: both; } #contents .dateTotal { font-size: 130%; text-align: right; } #contents .credittxt { color:#339900; } #contents .dateTotalAmntCredit { font-size: 130%; color:#339900; } #contents .dateTotalAmntDebit { font-size: 130%; color:#990000; } --> </style> <div id="contents"> <div class="payPeriod">pay period: 2008-06-14 <div class="dateBlock">2008-06-14 <div class="transaction"> <div class="details"> <span class="group">merchant </span> <span class="description">merchant </span> </div> <div class="amount"> <span class="credittxt">2424.42</span> </div> <div class="posted">1</div> </div> <div class="transaction"> <div class="details"> <span class="group">test bill </span> <span class="description">test bill </span> </div> <div class="amount"> -20.00 </div> <div class="posted">1</div> </div> <div class="dateTotal">balance <span class="dateTotalAmntCredit">2404.42</span></div> </div> </div> </div> Hello, I've got 3 questions on my mind right now and I can't find answers through the searches. All of them out of curiosity as I try to learn CSS. First, why can't I get my containers height to automatically adjust to the content? Code: #container { position: relative; width: 665px; margin: 0 auto 0 auto; background: #FFFFFF; border: 1px solid #505050; } #buttons { position: absolute; top: 0px; left: 0px; height: 300px; width: 100px; background: #CCCCCC; } // HTML <div id='container'> <div id='buttons'> buttons </div> </div> Second question, what is with the :after I see in CSS examples. I can't get a search on it, so I can't figure out what it is for. I usually see it in a context like (.container:after). Third question, what is with the trailing slash I see before a tag is closed. I think it has something to do with HTML Strict or something. I usually see it in a context like (<tag></tag \>) thanks for the help webg Layout Page I know. It's not too great yet. But I've just started and it's still in the baby stages. whenever I add a width or height paramater to "navBar" the background image NEVER shows up, even with content! Why is that? Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title>Coast Guard</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <meta http-equiv="Content-Style-Type" content="text/css"> <meta http-equiv="Content-Script-Type" content="text/javascript"> <style type="text/css"> body { background: url(Images/bgClouds2.jpg); height: 100%; } html { height: 100%; } .navigationBar { width: 150px; height: 1000px; background-image: url(Images/navBarImage.png); background-repeat: repeat-y; border-style: dotted; overflow: none; } #section { padding-left: 57px; overflow: none; font-size: 15px; text-align: left; } #top { width: 901px; height: 1000px; margin-left: auto; margin-right: auto; margin-top: 20px; margin-bottom: 0px; background-color: white; border-style: groove; border-color: darkblue; } #navBar { background-image: url(Images/navBG.jpg) height: 73px; border-style: dotted; } </style> <script type="text/javascript"> <!-- // --> </script> </head> <body> <div id="top"> <center> <img src="Images/CircleBanner.png" style= "border-style: none;" align="center"> </center> <div id="navBar"> alex wait </div> The situation is very simple: Code: <div id="maindiv" style="border:1px solid #000000; width:400px; margin:0px; padding:0px;"> <div id="reddiv" style="border:1px solid #FF0000; width:150px; float:left;"> red box<br> red box<br> red box<br> red box<br> red box<br> red box<br> </div> <div id="greendiv" style="border:1px solid #00FF00; margin-left:170px; width:100px;"> green box<br> green box<br> green box<br> green box<br> </div> </div> AS you can see, I have a main div. Inside it, I have 2 divs: red and green. If I enter text into the green div, the main div resizes automatically. But if I enter text into the red div, the main div doesn't resize, and so the red div overflows. What I need is either enter text in the red or green divs and make the main div to auto resize. (I'm using Mozilla FireFox) Any Idea? I may be trying to square the circle here. I have a container that is not the full length of the page [padding top and bottom]. Within the container, I have 2 main content elements: 1. a nested div forms a strip down the left edge, holding a decorative pattern. [note: it doesn't currently extend down the entire left edge ~ other items are above it ~ but I can include those in the strip and make it 100% if the idea is workable]. 2. the main content div is beside it. The container automatically adjusts to the height of the entire content in both divs. I'd like for the 'decorative' div to automatically adjust to 100% height of the container instead [ie. match the height of the content to the right of it - automatically]. Is this possible? Kravvitz....I know |