CSS - Getting A Container To Extend To The Bottom Of Its Contents!
Hi guys,
I'm having a real problem with CSS on this page. The page views fine in IE, but in firefox I cannot get the green box (div id=maincontent) to extend down to the bottom of the black box... as you can see the black box simply flows out. The green box is extending down to the bottom of the white box, but it stops there. Can anyone think of any obvious ways to fix this? I tried placing a clear:both div at the bottom of main content (which is the red bar you can see) , but that too only actually clears the white box, not the black one. Here's the main bits of css... Code: #maincontent { position:relative; width:762px; margin-top:0px; background-image:url(contentbkg.jpg); background-repeat:no-repeat; padding-top:10px; text-align:left; } #left { font-size:12px; color:#FFFFFF; float:left; margin-left:5px; margin-top:10px; } #right { color:#FFFFFF; float:right; margin-right:10px; margin-top:10px; position:absolute; #position:relative; } #translucentblack { width: 150px; float:right; background-color: #000000; filter:alpha(opacity=40); -moz-opacity:0.4; opacity: 0.4; font-family:Verdana, Arial, Helvetica, sans-serif; padding:5px; } #opaqueblack { width: 150px; background-color: transparent; float:right; position:absolute; margin-left:592px; #margin-left:22px; z-index: 2; font-family:Verdana, Arial, Helvetica, sans-serif; padding:5px; } #translucentbkg { color:#FFFFFF; font-size:12px; width: 566px; background-color:#FFFFFF ; filter:alpha(opacity=80); -moz-opacity:0.8; opacity: 0.8; padding:5px; text-align:left; font-family:Verdana, Arial, Helvetica, sans-serif; } #opaquetext { color:#006600; font-size:12px; width: 566px; background-color: transparent; position:absolute; z-index: 2; padding:5px; text-align:left; font-family:Verdana, Arial, Helvetica, sans-serif; } basically left and right sit inside maincontent, then opaquetext and translucentbkg sit inside left, whilst opaqueblack and translucentblack sit inside right! phew The reason for opaque and translucent divs is that I'm using mozilla's tip here http://developer.mozilla.org/en/docs/Useful_CSS_tips:Color_and_Background mirroring content and positioning one div over another to get semi transparent backgrounds. Hope that all made sense... any help would be incredible!!! thanks! Similar TutorialsPlease see: http://www.larreamma.com/staff2.html Is there a better way to expand 'main2' then adding/increasing the 'margin-bottom' of the last (empty) paragraph? <p style="margin-bottom:150px"> </p> Without it the bottom floated image overlaps 'main2' and meets the footer. This was not an issue on the other pages of the site as the text extended beyond the floated image(s)/elements. C'mon Kravvitz... Hey everyone, I am just touching up an old design I made, and I just noticed that Firefox has a weird white-space next to the top menu. Not sure what is causing it, but it is there. Here is a screenshot of what is happening in Firefox. Also, in IE, the container doesn't extend past the bottom menu. Here is a screenshot of what is happening in IE. So far I am just testing in Firefox 2.0.0.11 and IE7. Here is my code: html4strict Code: Original - html4strict 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 http-equiv="Content-Style-Type" content="text/css" /> <meta http-equiv="Content-Script-Type" content="text/javascript" /> <title></title> <style type="text/css">/* <![CDATA[ */ * { padding: 0; margin: 0; } body { background-color: #6AB2DA; color: #000000; text-align: center; font-size: 13px; font-family: verdana,tahoma,"Bitstream Vera Sans",arial,helvetica,sans-serif; /* Thank you, Kravvitz */ } a { color: #6AB2DA; } a:focus { outline: 0 none; } #container { margin: 0 auto; text-align: justify; width: 50%; } #page { background-color: #FFFFFF; } #header { background-image: url( http://img443.imageshack.us/img443/8114/bg1bp4.jpg ); background-position: bottom left; height: 120px; width: 100%; } #header span { padding-left: 150px; padding-top: 50px; font-size: 21px; font-weight: bold; letter-spacing: -0.1em; color: #666666; display: block; } #menu { background-color: #6DC3DE; width: 100%; } #menu li { float: left; padding-top: 10px; padding-bottom: 11px; list-style-type: none; } #menu a { background-color: #6DC3DE; padding: 10px 20px; boreder: 2px solid transparent; color: #000000; } #news { clear: both; margin-top: 34px; overflow: auto; padding: 15px; height: 100px; border-bottom: 1px solid #0AA; } #news h1 { color: #6DC3DE; font-size: 21px; } #content { margin-top: 15px; padding: 15px; } #content h2 { padding-top: 10px; float: left; color: #6DC3DE; padding-right: 25px; font-size: 31px; border-right: 3px solid #6DC3DE; } #content .info { padding-top: 10px; padding-left: 25px; float: left; font-size: 11px; height: 31px; } #content p { text-indent: 45px; clear: both; border-bottom: 1px dotted #6DC3DE; padding-top: 10px; padding-bottom: 10px; } #bottom { border-top: 1px solid #6DC3DE; margin-top: 10px; padding: 5px; } #bottom ul#one { float: left; } #bottom ul#two { float: right; } #bottom li { padding-top: 10px; padding-bottom: 11px; list-style-type: none; display: block; } #bottom a { background-color: #6DC3DE; padding: 10px 20px; boreder: 2px solid transparent; color: #000000; display: block; width: 250px; } .clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } .clearfix {display: inline-block;} /* Hides from IE-mac \*/ * html .clearfix {height: 1%;} .clearfix {display: block;} /* End hide from IE-mac */ /* ]]> */ </style> </head> <body> <div id="container"> <div id="page"> <div id="header"><span>i.love.summer</span></div> <div id="menu"> <ul> <li><a href="">asdfasf</a><li> <li><a href="">asdfasf</a><li> <li><a href="">asdfasf</a><li> <li><a href="">asdfasf</a><li> <li><a href="">asdfasf</a><li> <li><a href="">asdfasf</a><li> <li><a href="">asdfasf</a><li> </ul> </div> <div id="news"> <h1>welcome</h1> Some gibberish to make the news/etc part extend. Some gibberish to make the news/etc part extend. Some gibberish to make the news/etc part extend. Some gibberish to make the news/etc part extend. Some gibberish to make the news/etc part extend. Some gibberish to make the news/etc part extend. Some gibberish to make the news/etc part extend. Some gibberish to make the news/etc part extend. Some gibberish to make the news/etc part extend. Some gibberish to make the news/etc part extend. Some gibberish to make the news/etc part extend. Some gibberish to make the news/etc part extend. </div> <div id="content"> <h2>I rock</h2> <div class="info"> author: BlackNine<br /> date: Today<br /> cat: eventually, right now I want a horse </div> <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Cras felis. Aliquam erat volutpat. Nunc sapien. Nunc ante felis, convallis eget, viverra sit amet, porttitor mollis, odio. Maecenas ut lorem sed eros pharetra euismod. Fusce quis est ac erat posuere elementum. Praesent id libero. Phasellus aliquet. Suspendisse pharetra sapien vitae mi. Suspendisse enim lectus, condimentum in, dictum sed, convallis in, sapien. Pellentesque mollis, quam sit amet tincidunt lacinia, urna erat interdum diam, vel aliquam enim nisl vitae velit. Nam sagittis tristique ipsum. Sed auctor eros non tortor. Vestibulum eros mauris, ultrices in, pulvinar ut, placerat in, metus. Nullam est odio, ullamcorper vitae, consequat a, laoreet non, sem. Mauris porttitor diam vel nisl. Curabitur vitae mauris a sem ornare congue. Morbi eu nibh sed enim molestie aliquet. Mauris auctor auctor mi. Nunc ultricies sem eget ipsum. Maecenas risus. Mauris pharetra, quam at luctus nonummy, diam magna porta urna, in fermentum massa enim vel augue. Morbi elit. Quisque posuere tincidunt ipsum. Integer vel metus ac risus venenatis vehicula. Duis lacus. In pellentesque diam at dui. Nunc feugiat elementum nisi. Phasellus auctor viverra sem. Pellentesque erat. Pellentesque mauris velit, posuere a, facilisis ac, gravida in, augue. Vestibulum at sem eu nulla nonummy ultricies. Ut a dui. Aenean sem. Etiam adipiscing, mauris nec mollis congue, quam dolor pretium nisi, vitae adipiscing urna diam a velit. In pellentesque massa vel massa. </p> <h2>I rock</h2> <div class="info"> author: BlackNine<br /> date: Today<br /> cat: eventually, right now I want a horse </div> <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Cras felis. Aliquam erat volutpat. Nunc sapien. Nunc ante felis, convallis eget, viverra sit amet, porttitor mollis, odio. Maecenas ut lorem sed eros pharetra euismod. Fusce quis est ac erat posuere elementum. Praesent id libero. Phasellus aliquet. Suspendisse pharetra sapien vitae mi. Suspendisse enim lectus, condimentum in, dictum sed, convallis in, sapien. Pellentesque mollis, quam sit amet tincidunt lacinia, urna erat interdum diam, vel aliquam enim nisl vitae velit. Nam sagittis tristique ipsum. Sed auctor eros non tortor. Vestibulum eros mauris, ultrices in, pulvinar ut, placerat in, metus. Nullam est odio, ullamcorper vitae, consequat a, laoreet non, sem. Mauris porttitor diam vel nisl. Curabitur vitae mauris a sem ornare congue. Morbi eu nibh sed enim molestie aliquet. Mauris auctor auctor mi. Nunc ultricies sem eget ipsum. Maecenas risus. Mauris pharetra, quam at luctus nonummy, diam magna porta urna, in fermentum massa enim vel augue. Morbi elit. Quisque posuere tincidunt ipsum. Integer vel metus ac risus venenatis vehicula. Duis lacus. In pellentesque diam at dui. Nunc feugiat elementum nisi. Phasellus auctor viverra sem. Pellentesque erat. Pellentesque mauris velit, posuere a, facilisis ac, gravida in, augue. Vestibulum at sem eu nulla nonummy ultricies. Ut a dui. Aenean sem. Etiam adipiscing, mauris nec mollis congue, quam dolor pretium nisi, vitae adipiscing urna diam a velit. In pellentesque massa vel massa. </p> </div> <div id="bottom"> <ul id="one"> <li><a href="">asf</a></li> <li><a href="">asf</a></li> <li><a href="">asf</a></li> <li><a href="">asf</a></li> </ul> <ul id="two"> <li><a href="">asf</a></li> <li><a href="">asf</a></li> <li><a href="">asf</a></li> <li><a href="">asf</a></li> </ul> </div> <div class="clearfix"></div> </div> </div> </body> </html> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" Any suggestions would be great. Well, I'm trying to make a comments-page for a certain thing, and I can't get the image to stop going over the bottom of the div, without using the min-height property. Can someone help?
Code: <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US"> <head> <meta http-equiv="Content-Type" content="application/xhtml+xml; encoding=UTF-8;" /> <title>Comments on 2005-02-10: February 10, 2005</title>\n <link rel="stylesheet" type="text/css" href="comments.css" /> </head> <body> <h2>Posting on 2005-02-10: February 10, 2005 in <a href="refresh.php" id="title">XMLBlog</a></h2> <div id="entry" xml:lang="en-US" lang="en-US"> <img src="../resources/images/Neil_Euphonium_3_[F][S{600,h}][32k].png" alt="New Euphonium!" title="New Euphonium!" style="width:30%;" class="left" /> <p class="dream">I can only remember two things... That there were a whole bunch of people from my school playing baritones, which was kind of creepy in this case <em class="entry">and</em> that my section from school in real life and I played this freaky, nonexistent Zelda games. One was for a calculator I had only owned in the dream, and it was spectacular! </p> <p class="normal">I brought my "newphonium" to school today.</p> <p class="normal">We had a pretty normal session in Jazz. <em class="entry">Someone actually got a trombone solo.</em></p> <p class="normal">Our teacher was back. The entire first half of the period going over our homework. <em class="entry">We learned that dropping a penny off of the <strong class="entry">Space Needle</strong> is very dangerous, since even a baseball would get going at 120 MPH.</em> Later, we began how to calculate things dealing with gravity with a position other than 0 and a velocity over 0.</p> <p class="happy">We didn't do much in Japanese. All we really did was read Katakana and finish our puzzle. <em class="entry">A few of us found new words.</em> I also told our sensei that my real Japanese same from my ancestors is <ruby><rb>たけした</rb><rt>take****a</rt></ruby>. During resource, I looked over this book with a couple of friends of mine and their friend. <em class="entry">It was so funny, too!</em></p> <p class="normal">In Health, we continued our lecture on alcohol. <em class="entry">There were some inspiring articles and poems on the subject.</em></p> <p class="happy"><span class="normal">Class started off with a lock-down. <em class="entry">I used this time to complete a gravity-based program for physics.</em></span> to Due to my premature completion of the paragraph that was due at the end of the period, I just listened to music and read for the majority of English. <em class="entry">A big guy in the <info popup="State of Fear">book I'm reading</info> died.</em></p> <p class="sad">Before actually eating, I wandered a bit. <em class="entry">It made it so I didn't have to carry my backpack around wherever I went.</em></p> <p class="normal">We continued on proofs. <em class="entry">It took a bit of effort to do.</em> <span class="happy">Still, we finished the investigation.</span></p> <p class="normal"><span class="happy">I got my new euphonium for class.<em class="entry">It sounded very nice.</em></span> Though, for a majority of the time I didn't do anything with my section, due to his preoccupation with a couple of other kids.</p> <p class="happy">I got a ride home</p> <p class="normal">I had a practice session with my mom, which wasn't the most successful.</p> <p class="happy">Once done with my homework, I took a two-hour nap.</p> <p class="dream">The entire thing revolved around this country area that had tiny roads and a <info popup="The salmon eggs would get bigger, then would grow spikes and split apart before returning to their grating to mature more">freaky salmon farm</info>. Also, I remember psychically communicating with my section from Band. <span class="hider">I actually cried over the idea of losing him, but I didn't have tears when I awoke.</span> Also, my old friend, who is a freshman now, was mentioned.</p> <p class="happy">The dream gave me the idea to call him up. <em class="entry">Apparently, the call woke him up.</em> We talked about how our lives were going, along with school. <em class="entry">Apparently, the school banned people from using their calculators. How could they!? He also told me that some kids were goofing around during Breakout library time.</em> We scheduled a time to meet and talk about some more things. <em class="entry">I could show him Linux.</em></p> <p class="happy"><strong class="entry">I fixed the comments system!!</strong> <em class="entry">Have fun posting.</em></p> </div><p>No comments</p><hr /><form action="postcomments.php?ie=&title=February 10, 2005&date=2005-02-10" method="post" name="comment" id="main"> <div class="right"> <img src="comments_files/right_main_bar.png" alt="right_side" /> </div> <div class="left"> <img src="comments_files/left_main_bar.png" alt="left_side" /> </div> <div class="center"> Date: <input type="textarea" class="upper" name="date" value="2005-02-10" readonly="readonly" /> Title: <input type="textarea" class="upper" name="title" value="February 10, 2005" readonly="readonly" /> <br /> Name: <input type="textarea" name="name" class="lower" /> E-mail: <input type="textarea" name="e-mail" class="lower" /> </div> <div class="comment"> <input type="textarea" name="comment" class="text" /> <input type="submit" value="Post!" class="click" /> </div> </form> </body> </html> CSS: Code: h2 { text-align:center; font:bold italic 3em/1.5 'Pepita MT', 'Lucida Handwriting', 'Sans-Serif'; color:rgb(0,150,150); } h3 { text-align:center; font: italic normal 2em/1.5 'Lucida Calligraphy', 'Sans-Serif'; color:rgb(0,0,150); } form#main { display:block; } form#main div.left { float:left; background-color:rgb(255,255,255); } form#main div.right { float:right; background-color:rgb(255,255,255); } form#main div.left img, form#main div.right img { height:60px; } form#main div.center { background-color:rgb(0,0,0); background:url(comments_files/center_main_bar.png); font:bold normal 1em/1 'Times New Roman', 'Courier New', 'Sans-Serif'; color:rgb(255,255,255); padding:2px 18% 2px 28%; } form#main div.center input.upper { height:20px; filter: alpha(opacity=50); -moz-opacity: .5; display:inline; width:20%; margin:2px 10% 2px 0; } form#main div.center input.lower { height:20px; filter: alpha(opacity=50); -moz-opacity: .5; display:inline; width:20%; margin:2px 8% 2px 0; } form#main div.comment { width:95%; border:1px solid rgb(0,150,150); } form#main div.comment input.text{ width:90%; margin:5px 5% 5px 5%; height:100px; } form#main div.comment input.click { width:25%; margin:5px 37.5% 5px 37.5%; } body p { text-align:justify; font: italic normal 1.2em/1 'MS Mincho', 'SimSun', 'Sans-Serif'; color:rgb(150,0,0); } a { color:rgb(0,100,0); text-align:left; } a:hover { font-weight:bold; color:rgb(0,255,0); border:1px solid rgb(0,255,0); } a#title { color:rgb(0,100,0); text-decoration:none; margin-left 25%; text-align:left; } a#title:hover { font-weight:bold; color:rgb(0,255,0); border:1px solid rgb(0,255,0); } div.comment a.mail { font:normal normal 1.2em/1.1 'MS Mincho', 'SimSun', 'Courier New', 'Sans-serif'; color:rgb(0,100,0); text-decoration:none; text-align:left; } div.comment a.mail:hover { font-weight:bold; color:rgb(0,255,0); border:1px solid rgb(0,255,0); } div.comment span.mail { margin-left 25%; font:normal normal 1.2em/1.1 'MS Mincho', 'SimSun', 'Courier New', 'Sans-serif'; color:rgb(0,0,150); text-align:left; } div.comment { border-bottom:2px dotted rgb(0,0,255); margin:1.5em; } div.comment p { font:normal normal 1.2em/1.1 'MS Mincho', 'SimSun', 'Courier New', 'Sans-serif'; display:block; } /* ENTRY */ div#entry { border:4px double rgb(0,0,0); padding:0.25em; margin:0.5em; min-height:79em; } div#entry p { font:normal normal 1em/1.2 'Tempus Sans ITC', 'Nimbus Roman', 'Times New Roman', 'Serif'; text-indent:2em; text-align:justify; } div#entry p.dream { font:normal normal 1em/1.2 'Lucida Handwriting', 'URW Chancery L', 'Serif'; color:rgb(150,150,0); text-indent:2em; text-align:justify; } em.entry { font-style:italic; } strong.entry { font-weight:bold; } span.uentry { text-decoration:underline; } span.hider { color:rgb(255,255,255); } div.story { border-left:2px solid rgb(0,0,0); border-top:2px solid rgb(0,0,00; } div.story div.title { border-bottom:1px solid rgb(128,128,128); border-right:1px solid rgb(128,128,128); font:italic normal 1.5em/1.2 'Tempus Sans ITC', 'Nimbus Roman', 'Times New Roman', 'Serif'; width:50%; text-align:center; } div.story div.storybody { padding:0.25em; } span.happy, p.happy { color:rgb(0,100,0); } span.sad, p.sad { color:rgb(0,0,100); } span.normal, p.normal { color:rgb(100,0,0); } img.center { margin:0.25em auto; } img.right { float:right; margin:0.25em; } img.left { float:left; margin:0.25em; } Hi All, I am trying to get the container div to contain the contents of the page, so that if someone has a lower res browser / reduces the size of the page, the whole thing colapses inwards. I simplly cannot get it to work! In IE it does not shrink, in FF the container shrinks, but the elements inside it dont. Charlie Thanks for taking the time to read my question. I have a container that has a bunch of stuff in it. In IE the container grows (I know it shouldn't) with the content. FF the content doesn't. I want to use the same container on each page in my site, but each page will have different amounts of content making the page longer or shorter. I need the container to match the contents, and I would like to do it without making duplicates of the container in the CSS and changing only the height. For an example check out warrenpersowich.com Look at the home page and the Seminars page. See how the content is differen, but the container is the same. Thanks, Brad Hey guys I'm creating a website as a favor for my boss and I've been trying to do the speed crunch on it and already, one day in I hit a big road block... I can't seem to get the content container and background div to resize with content inside the "content" div. And also, I can't get the footer image for the content container (bottom of the color w/ rounded edges) to float to the bottom of the container. Here is the page in question: http://srh.com/taxgirl/ There are 3 style sheets used so far (as this is a complex website and I want some parts to show on all pages and others to only show on certain pages. Here are the CSS links: http://www.srh.com/taxgirl/srh2008.css http://www.srh.com/taxgirl/css/mainsrh.css http://www.srh.com/taxgirl/css/srh_index.css Code: #contentcontainer { position: absolute; z-index: 3; width: 740px; left: 11px; top: 505px; right: 11px; height: auto; margin-bottom: 70px; overflow: visible; font-family: Arial, Helvetica, sans-serif; font-size: 12px; color: #FFFFFF; text-align: left; } Code: #contentbg { background-image: url(../images2/required/layout/contentbg.png); background-repeat: repeat-y; background-position: center top; overflow: visible; position: relative; width: 760px; top: 55px; height: 900px; left: 1px; right: 0px; bottom: 65px; z-index: 2; margin-bottom: 63; } #contentcontainterfooter { height: 15px; width: 760px; position: relative; left: 1px; right: 0px; z-index:3; } Here is the HTML: Code: <div class="contentbg" id="contentbg"> <div class="contentcontainer" id="contentcontainer">CONTENTS THAT NEEDS The Content bg to be relative to.</div></div> <div class="contentcontainterfooter" id="contentcontainterfooter"><img src="images2/required/layout/content_bottom.png" width="760" height="15"></div> The text I threw in the DIV is just sample text so please disregard any unlisted or unused class tags, etc. This text will be removed after the issue is solved. If anyone could help I would be forever greatful Please take a look and let me know if you have any advice. Thanks you so--o much! ~beth. ps. This is a side concern, but if anyone knows how to make a png background compatable with IE, please do tell. This isn't too big of a concern for me because if I need to I can just use a gif, but if you know, the knowledge would be welcome and thanked for To all that read: Have a fantastic day and thank you for your time. Hi, I've a problem with a layout, I don't understand why div container appears smaller than input field contained. PHP Code: <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <style type="text/css" > body { margin : 10px; background-color : gray; } .container{ background-color : orange; border : 3px solid black; padding : 40px; } </style> </head> <body > <div class="container"> <input name="prova" value="Look to the right -----> -----> -----> -----> -----> " type="text" style="width:2000px;"> </div> </body> </html> ps. Verified with Firefox 2.0.0.4 and mozilla 1.7.13 Any hint? Ok. Here's the problem: I have a asp.net 1.x datagrid inside a floated div and I want the datagrid to stretch the width of the div. This div is in the center of two other floated divs. Is there a way to make a table go 100% the width of its container div? Css code: Code: /* left bar: */ #navBar{ width: 185px; float: left; } /* right bar: */ #rightModulesContainer { width: 130px; margin: 0; padding: 0px 0px 0px 10px; float: right; } /* center content: */ #content{ padding: 0px 5px 0px 0px; margin-top:0; margin-bottom:0; margin-left:4px; margin-right:0px; float: left; text-align:left; /*display: inline;*/ } /* contained in #container: */ #dataGridContainer{ margin: 0; padding-bottom: 10px; min-width:360px; } .categoryGridStyle { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; font-style: normal; color: #000000; width:100%; } and here is the layout of the divs: Code: <div id="navBar">left navigation bar here (tree view)</div> <div id="rightModulesContainer">right side bar here</div> <div id="content"><div id="dataGridContainer">datagrid here</div></div> Thanks for your help in advance. I've been messing with this for a while - trying to get it to work cross browser is driving me nuts. I've tried placing the divs in containers and floating the containers, I've tried everything I can think of... Code: html, body { margin: 0; padding: 0; font: 62.5%/1.5; } #container { width: 770px; margin: 15px auto 15px auto; background: white; } #headera { height: 57px; } #nav { background: white; height: 28px; } #headerb { height: 158px; margin-bottom:10px; } #sidebar { float: right; width: 250px; } #content { margin-right: 250px; } #footer { clear: both; background: white; height: 50px; } IE is not recognizing the bottom margin for the container. The container is centered and 15px off the top of the page but the bottom of the container is not 15px off the bottom of the page. It works fine in other browsers. So, what IE bug is this? Hi, I'm trying to do something that is simple with table cells but which I'm finding difficult using CSS. Basically I have a container div that is 400px height. I want to position 3 divs in a row (float: left) at the bottom of that div and put an image in each of them. So, in short... <div id="outer"> <div id="inner1"><img src="x.jpg" /></div> <div id="inner2"><img src="y.jpg" /></div> <div id="inner3"><img src="z.jpg" /></div> </div> ...where the three images are bottom aligned. I want to have the images in their own div containers so that I can give each of their boxes 33% of the screen width and set apdding if required. No doubt I'm approaching this the wrong way. Can anyone help? Thanks, Pat I have a container div that has a height of 500px. My page content only takes up about 300px and I want a copyright notice at the bottom of the page. So I am trying to get the copyright div to bottom align on the container div. In FF, position:absolute;bottom:0; works but that doesn't work in IE which for some reason places the div outside the container div. Any tips on how to do this? I'm attempting to get it so when the main content div exceeds my min-height specifications, that it expands the div, which in turn expands the container with an absolutely positioned footer at bottom:0;. Works fine in all newer browsers with the exception of IE7. What do I need to do to get it to expand in that version? Here is the link to the page: http://www.chcs-ut.com/chcs-new.php And the stylesheet: http://www.chcs-ut.com/css/style.css Also, I would really rather not have to specify a min-height for my main content div. I'd rather just have it automatically fill to 100% of the main container that is set to 100% height and min-height, so that the footer automatically appears at the bottom of the screen if the content is not large enough to push it down there by itself. Can't seem to get it to work, though (in ANY browser) without specifying a min-height for the main content div. Problem with that is different resolutions/browsers would require a different value, so hard-coding it isn't a desireable solution. Any thoughts? EDIT: Both problems were fixed by adding "height:auto !important" to my main content container, instead of specifying a "min-height". Works across the board! Hi All, I'm trying to create some expanding headers using images and background color/images. Everything seems to be working fine except that at the bottom of the heading there is a 1 or 2 pixel showing of the background color! I assume it is something I'm missing in the CSS rule as the problem occurs in both Mozilla and IE! Click here to see example It's not the images as there on a white background and are cropped fine as can be seen from the enlarged left side image. [html] <div style="width: 162px; color: white; background: green; margin: 0; padding: 0;"><img src="/RhL.gif" width="25" height="50" border="0"><span>HEADING TEXT</span><img src="/RhR.gif" width="25" height="25"></div> [/html] Any help kindly appreciated PHP Addict Hi There - Have a simple container div containing two other divs, top and content. My problem is that I can't get the colorboxtop to stick to the top of its container. There's a wayward space. Can't find any stray margins or padding hanging around. Perhaps fresh eyes can see what I cannot. Please let me know. Any help you can give me would be greatly appreciated. Thanks! Code: <body> <div class="colorbox"> <div class="colorboxtop"> <h2>title goes here</h2> </div><!-- /colorboxtop --> <div class="boxcontent"> <p>You should read this and <a href="#">Click Here</a>.</p> <a title="Go Here!" href="#">[button]</a> </div><!-- /boxcontent --> </div><!-- /colorbox --> </body> No great complexity there...here's the CSS: Code: body { color:#666666; font-family:Lucida Grande,Verdana,sans; font-size:10px; font-size-adjust:none; font-style:normal; font-variant:normal; font-weight:normal; line-height:13px; } .colorbox { margin-bottom:9px; padding-bottom:15px; width:300px; border:thin solid #CCCCCC; } .colorbox h2 { color:#FFCC33; } .colorbox { color:#CC6633; padding:0px 20px 15px; margin-top:0; margin-bottom:10px; } .colorboxtop { background-color: #dddddd; height:50px; color:#666666; background-image: url(images/bg_Tiles/stripe-dk-blue-green.png); padding:auto 20px; } .colorbox a { color:#C5DBE9; font-weight:bold; text-decoration:none; } this is bugging the hell out of me, cant find a working answer anywhere (i've tried a bunch of things) So I have 3 images for the top of my page and 3 images for the bottom. The page is enclosed in a div frame titled "frame" each of the 3 columns is enclosed in a frame "leftframe" "centerframe" and "rightframe" Each of the 3 columns has a top which is a fixed size image at the top, a middle which is just empty space for content to go, and a bottom which is a fixed size image at the bottom. Problem: I can't get any of the 3 column's bottoms to stick to the bottom of "frame" I've tried some code in here to do it and it doesn't work.. any help here? thanks! Code: <style type="text/css"> body { text-align:center; height:100%; min-height:100%; padding:0px; } #frame { width:800px; height:100%; min-height:100%; margin-right:auto; margin-left:auto; margin-top:0px; padding:0px; text-align:left; position:relative; } #contentlefttop { width:155px; height:282px; padding:0px; float:left; background-image: url(images/layout_01.gif); background-repeat:no-repeat; } #leftframe { float:left; width:155px; position:relative; height:100%; min-height:100%; } #contentleft { clear:left; float:left; padding:0px; width:155px; padding-bottom:270px; } #contentleftbottom{ width:155px; height:270px; /*clear:left; float:left;*/ padding:0px; position:absolute; bottom:0; background-image: url(images/layout_07.gif); background-repeat:no-repeat; } #contentcenter { width:486px; padding:0px; clear:left; float:left; text-align:center; min-height:100%; height:100%; padding-bottom:53px; } #rightframe { float:left; position:relative; height:100%; min-height:100%; width:159px; } #centerframe { float:left; position:relative; height:100%; width:486px; } #contentrighttop { width:159px; height:282px; padding:0px; clear:left; float:left; background-image:url(images/layout_03.gif); background-repeat:no-repeat; background-position:top; } #contentright { clear:left; float:left; width:159px; padding:0px; height:100%; padding-bottom:270px; } #contentrightbottom{ width:159px; height:270px; /*clear:left; float:left;*/ position:absolute; bottom:0; padding:0px; background-image: url(images/layout_08.gif); background-repeat:no-repeat; background-position:bottom; } #contentheader { width:486px; height:135px; float:left; background-image: url(images/layout_02.gif); background-repeat:no-repeat; } #contentfooter { /*clear:left; float:left;*/ width:486px; height:53px; background-image: url(images/layout_09.gif); background-repeat:no-repeat; position:absolute; bottom:0; } #sitemessage { margin-left:17px; margin-right:31px; height:90px; text-align:center; font-size:12px; } #wisemanquote { margin-left:22px; margin-right:24px; height:85px; text-align:center; font-size:12px; } p,h1,pre { margin:0px 10px 10px 10px; } h1 { font-size:14px; padding-top:10px; } #contentheader h1 { font-size:14px; padding:10px; margin:0px; } #contentright p { font-size:10px} </style> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> </head> <body bgcolor="#FFFFFF"> <div id="frame"> <div id="leftframe"> <div id="contentlefttop"> <div id="sitemessage"></div> </div> <div id="contentleft">Left</div> <div id="contentleftbottom"></div> </div> <div id="centerframe"> <div id="contentheader"></div> <div id="contentcenter"> <p>Center</p> </div> <div id="contentfooter"></div> </div> <div id="rightframe"> <div id="contentrighttop"> <div id="wisemanquote"></div> </div> <div id="contentright">Right</div> <div id="contentrightbottom"></div> </div> </div> Hi -- I am trying to set up a really basic css layout, and it just isn't working out for me. All I want is for the page to be split down the middle, and a footer than spans the full width of the page. Here's what I have: CSS: Code: body { color: #FFFFFF; background-color: #000; } #leftcontent{ float:left; width:50%; border:0px; padding:0px; color:#FFFFFF; background-color:#000; } #rightcontent{ margin-left:50%; margin-right:0px; width:100%; border:0px; padding:0px; color: #000; background-color:#FFFFFF; } #bottomcontent{ float: bottom; margin-bottom:0px; width:100%; border:none; padding: 10px; position:fixed; bottom:0; background-color:#FBBF0D; } HTML: Code: <html> <head> <title>Crap!</title> <link rel='stylesheet' href='css.css' type='text/css' /> </head> <body topmargin="0" leftmargin="0" marginheight="0" marginwidth="0" rightmargin="0"> <div id="leftcontent"> <h1>A logo will go here</h1> </div> <div id="rightcontent"> <h1>A navigational bar will go here</h1> <br clear ="all" /> </div> <div id="bottomcontent"> <center> <h1>Another logo will go here</h1> </center> </div> It works in IE 5.2 for Mac, but not in Safari, so I know something is very wrong, but I can't figure out what. Please help! Hello there, first post, just need a quick fix. Hope you don't mind. So I'm trying to make myself a new portfolio site, but there's this 'error' I can't seem to fix... (Can't post a link in my first post, so just copy/paste "hellspike.thanez.org/newsite" in the addybar.) Basically that 150*300 infobar is supposed to be right next to the image, but it always ends up above or below the container. <!--AK47--> <div id="imgcont0"> <div id="imgcont1"><img src="images/ak47/1.jpg"></div> <div id="imgcont2"><img src="images/ak47/info.jpg"></div> </div> <!--/AK47--> imgcont0 is a 825*300 container, in which imcont1 (render) and 2 (infobar) are supposed to be. Stylesheet: #imgcont0 { width: 825px; height: 300px; margin-left: auto; margin-right: auto; } #imgcont1 { width: 650px; } #imgcont2 { margin-left: 675px; width: 150px; } As you see the code is simple, yet I can't seem to fix this problem. Ideas? Hi, I like to know how to extend an existing class. .footertext50per { PADDING-RIGHT: 5px; PADDING-LEFT: 10px; PADDING-BOTTOM: 3px; WIDTH: 50%; COLOR: #c1cfe9; PADDING-TOP: 1px; } .footertext50perleft { PADDING-RIGHT: 5px; PADDING-LEFT: 10px; PADDING-BOTTOM: 3px; WIDTH: 50%; COLOR: #c1cfe9; PADDING-TOP: 1px; TEXT-ALIGN: left } As you see in the second class "footertext50perleft", the only difference with respect to the first class "footertext50per" is the 'text-align'. This lead to duplication of coded. I like to know whether it is possible to extend "footertext50per" to "footertext50perleft" and just define the additions or modifications only. Thanks. Hello everybody, I present myself, I'm Alessandro a new member from Italy. I found this forum very useful. Hope to find good answers following topics and hope to help someone when I'm able to. Ciaooooo I have this issue for the moment: I have a homepage layout with 3 columns with an images and captions inside everyone. I have a subtitle also, and I want the subtitle extends orizzontally over the div without resizing it and without rollbars. see a screenshot he http://www.alessandroboselli.it/foto/screenshot.jpg and here is the involved CSS code: Code: /* Homepage layout --- start */ #wrapper { text-align: left; margin: 0px auto; padding: 0px; border:0; width: 980px; } #side-left { float: left; width: 300px; } #center { float: left; width: 300px; } #side-right { float: right; width: 380px; } /* Homepage layout --- end */ /* Homepage images --- start */ .homepageimage { position:relative; float:left; /* optional */ top:40px; -moz-box-shadow: 3px 3px 4px rgba(0,0,0,0.5); -webkit-box-shadow: 3px 3px 4px rgba(0,0,0,0.5); box-shadow: 3px 3px 4px rgba(0,0,0,0.5); /* For IE 8 */ -ms-filter: "progid:DXImageTransform.Microsoft.Shadow(Strength=4, Direction=135, Color='#5f5f5f')"; /* For IE 5.5 - 7 */ filter: progid:DXImageTransform.Microsoft.Shadow(Strength=4, Direction=135, Color='#5f5f5f'); } .homepageimage a { text-decoration: none; float: left; } .homepageimage a .homepageimagetitle { display: block; font-family: 'Molengo', Arial, serif; font-size: 18px; font-style: normal; font-weight: 400; text-shadow: none; text-decoration: none; letter-spacing: 0.050em; word-spacing: 0em; line-height: 1.2; padding: 10px 0; background: #111; filter:alpha(opacity=75); opacity:.75; -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=75)"; color: #fff; position: absolute; top: 0px; left: 0px; padding: 5px; margin: 0; width: 190px; /*position: absolute; right: 20px; bottom: 20px; filter:alpha(opacity=65); opacity:.65; -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=65)"; /*--IE 8 Transparency--*/ } .homepageimage a .homepageimagesub { display: block; font-family: 'Buda', serif; font-size: 22px; font-style: normal; font-weight: 400; text-shadow: none; text-decoration: underline; text-transform: none; letter-spacing: 0.007em; word-spacing: 0em; line-height: 1.15; padding: 10px 0; background: #111; filter:alpha(opacity=75); opacity:.75; -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=75)"; color: #fff; position: absolute; top: 215px; left: 0px; padding: 5px; margin: 0; } |