CSS - Setting Height To Auto
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! 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? Coding my site up, and I've hit a stump. I've got a box div that I'm putting text in. I try adjusting the height, and it works fine in Mozilla/Firebird, but IE just seems to ignore it (which is causing me problems). Anyone familiar with this? I've got a problematic background DIV. It fills up the entire viewport and looks correct, but cuts off at the bottom (one screen height down) when I scroll. How can I get this DIV to span the entire height of the document, instead of just the height of the viewport? BTW, it works fine in IE 6, but cuts off in FireFox 0.9, Opera 7.5, and Netscape 7.1 Here's the code (you'll have to populate the content DIV to get scrollbars and witness the problem): Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <style type="text/css"> <!-- body { margin: 0; padding: 0; height: 100%; background-color: #F1EFE2; } html { margin: 0; padding: 0; height: 100%; } .bg { position: relative; margin-top: 0px; margin-left: auto; margin-right: auto; margin-bottom: 0px; width: 960px; height: 100%; background: #F7F6EF; text-align: center; border-right-color: #9E987F; border-right-width: 1px; border-right-style: solid; border-left-width: 1px; border-left-style: solid; border-left-color: #9E987F; } .heading { position: relative; margin-top: 0px; margin-left: 0px; margin-right: 0px; width: 100%; background: #7C2812; color: #F7F6EF; vertical-align: middle; text-align:left; padding-top: 10px; padding-bottom: 10px; text-indent: 10px; } .content { position: relative; top: 20px; padding-left: 15px; padding-right: 15px; width: 920px; vertical-align: top; text-align:left; } --> </style> </head> <body onResize="window.location.href = window.location.href;"> <div class="bg"> <div class="heading"> heading goes here </div> <div class="content"> content goes here </div> </div> </body> </html> Any help would be greatly appreciated! Greets, I'm trying to get the follwing collumns to display on the complete height of the element they are nested in. Each of the 3 collumns currently only take the space required by the content that is in said element. Preview: The current layout is set with 3 divs (2 left floating, and the bigger one on right-float). I don't want to use tables/cells and I cannot use min-height as the content will be filled by the customer using a CMS. I Wish i could use something like: Code: #col_1 {height: parent.height;} here is a link to the actual page, please note that to use the style i am talking about you will have to use the top left select element and choose GH_02 -v. (this is my 1st attempt to have the same content with multiple css sets...) this is my layout as of now http://72.232.208.44/new/ you can probally look at it and see what else needs to be done, its very close to completion. theres a div called "left-side-gradient" which is that small thing light bluegreenish line down the left side. right now how ti works is however long i set that line to be is how long the main content area is. which is backwards, i need the left-side-gradient line to be however long the main content div is. and the main content div needs to always stretch down to the bottom panel i've tried everything with all sorts of css variations and i can't figure it out. also i need to do the same sort of effect to the right-side-gradient. but im sure if someone tells me how i can fix the left side i can apply the same sort of rules to the right side. also the top banner portion and the lower content portion has this small gap in them. i can't seem to get that gap to go away either :/ (my html and css are w3 validated) HTML Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title>page</title> <SCRIPT SRC="javascript.js" type="text/javascript"></SCRIPT> <link rel="stylesheet" type="text/css" href="stylesheet.css"> </head> <body> <div id="container"> <div id="banner"> </div> <div id="banner_under"> <ul id="float_ul"> <li><a href="index.html" onMouseover="lightup('pic1')" onMouseout="turnoff('pic1')"><img src="images/bHome.jpg" class="noborder" name="pic1" width="56" height="28" alt="Go Fast Gaming - Home"></a></li> <li><a href="services.php" onMouseover="lightup('pic2')" onMouseout="turnoff('pic2')"><img src="images/bServices.jpg" class="noborder" name="pic2" width="78" height="28" alt="Go Fast Gaming - Services"></a></li> <li><a href="contact.php" onMouseover="lightup('pic3')" onMouseout="turnoff('pic3')"><img src="images/bContact.jpg" class="noborder" name="pic3" width="73" height="28" alt="Go Fast Gaming - Contact"></a></li> <li><a href="controlpanel.php" onMouseover="lightup('pic4')" onMouseout="turnoff('pic4')"><img src="images/bControlPanel.jpg" class="noborder" name="pic4" width="113" height="28" alt="GO Fast Gaming - Control Panel"></a></li> </ul> </div> <div id="below_banner_container"> <ul id="float_ul"> <li><div id="top-left-gradient-extension"></div></li> <li><div id="top-middle-extension"></div></li> <li><div id="right-side-extension"></div></li> <li><div id="top-right-extension"></div></li> </ul> <ul id="float_ul"> <li> <div id="left_main"> <ul id="float_ul"> <li><div id="left-side-gradient"></div></li> <li><div id="content_area"><h2>Big Title</h2><br>stuffstuffstuffstuff stuffstuffstuffstuffstuffstuff stuffstuffstuff stuff stuff stuff stuff stuff stuff stuff stuff stuff stuff stuff stuff stuff stuff stuff stuff stuff stuff</div></li> </ul> </div> <div id="right_main"> <ul id="float_ul"> <li><div id="right-side-gradient"></div></li> <li><div id="right-side-text">falala f f f f f f f f f f f f f f f f f f f f f f f f f fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvvvv</div></li> </ul> <ul id="float_ul"> <li><div id="right-side-split"></div></li> </ul> <ul id="float_ul"> <li><div id="right-side-gradient"></div></li> <li><div id="right-side-text">falala f f f f f f f f f f f f f f f f f f f f f f f f f fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvvvv</div></li> </ul> </div> </li> </ul> <ul id="float_ul"> <li> <div id="bottom_panel-upper"> textextextext </div> <div id="bottom_panel-lower"> text text text text </div> </li> </ul> </div> </div> </body> </html> CSS Code: BODY{background-color:#003333;margin:auto;} .noborder{border:thin none #000000;} .center_text{ text-align:center; } #float_ul{ padding: 0; margin: 0; float: right; } #float_ul li { padding: 0; margin: 0; display: inline; list-style-type: none; float:left; } #container{ width:750px; margin:auto; text-align:center; } #below_banner_container{ border:thin none #000000; border-spacing:0; margin:auto;; text-align:center; padding:0; width:750px; } /* END MISC CLASSES BEGIN BANNER CLASSES */ #banner{ border:thin none #000000; border-spacing:0; padding:0; width:750px; height:155px; background-image:url("images/GFG-topBanner_01.jpg"); background-repeat: no-repeat; } #banner_under{ border:thin none #000000; border-spacing:0; padding:0; width:750px; height:28px; background-image:url("images/GFG-topBanner_02.jpg"); background-repeat: no-repeat; } /* END BANNER CLASSES BEGIN EXTENSION CLASSES */ #top-left-gradient-extension{ border:thin none #000000; border-spacing:0; padding:0; background-color:#339999; width:1px; height:30px; float:left; } #top-middle-extension{ border:thin none #000000; border-spacing:0; padding:0; background-color:#006666; width:500px; height:30px; text-align:left; vertical-align:top; } #right-side-extension{ border:thin none #000000; border-spacing:0; padding:0; background-color:#006666; width:49px; height:30px; background-image:url("images/right-side-extension.jpg"); background-repeat: no-repeat; } #top-right-extension{ border:thin none #000000; border-spacing:0; padding:0; background-color:#339999; width:200px; height:30px; background-image:url("images/top-right-extension.jpg"); background-repeat: no-repeat; } /* END EXTENSION CLASSES BEGIN LEFT SIDE CLASSES */ #left_main{ border:thin none #000000; border-spacing:0; padding:0; background-color:#006666; width:550px; text-align:left; vertical-align:top; float:left; } #left-side-gradient{ border:thin none #000000; border-spacing:0; padding:0; background-color:#339999; width:1px; height:400px; position:relative; } #content_area{ border:thin none #000000; border-spacing:0; padding:0; background-color:#006666; width:549px; text-align:left; vertical-align:top; background-image:url("images/left-side-gradient.jpg"); background-repeat: repeat-y; } /* END LEFT SIDE CLASSES BEGIN RIGHT SIDE CLASSES */ #right_main{ border:thin none #000000; border-spacing:0; padding:0; background-color:#339999; width:200px; text-align:left; vertical-align:top; float:right; } #right-side-gradient{ border:thin none #000000; border-spacing:0; padding:0; background-color:#339999; width:6px; height:100px; background-image:url("images/side-gradient.jpg"); background-repeat: repeat-y; position:relative; } #right-side-text{ border:thin none #000000; border-spacing:0; padding:0; background-color:#339999; width:194px; text-align:left; vertical-align:top; } #right-side-split{ border:thin none #000000; border-spacing:0; padding:0; background-color:#339999; width:200px; height:31px; background-image:url("images/right-column-split.jpg"); background-repeat: no-repeat; } /* END RIGHT SIDE CLASSES BEGIN BOTTOM PANEL CLASSES */ #bottom_panel-upper{ border:thin none #000000; border-spacing:0; padding:0; background-color:#339999; width:750px; height:20px; font-size:13px; text-align:center; vertical-align:top; } #bottom_panel-lower{ border:thin none #000000; border-spacing:0; padding:0; background-color:#339999; width:750px; height:20px; font-size:11px; text-align:center; vertical-align:top; } Is there a way that this can be done, basically I have a div hidden based on certain JS logic, but the amount of space of the content in the div is still taken up on the screen. I would like to make the div say 0xp and discard content. Is there any code that can help me, I've looked but can't find. Thanks Fixed. I'm wondering what's the word is called for setting the image width and height in CSS Code: img.test { <<What's the keyword??>>: 10 px; } Thanks, FletchSOD 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. 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 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? 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 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 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 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 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? 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> 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. |