CSS - Position 3 Div Elements At Bottom Of Container Div
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 Similar TutorialsCode: 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? I want to position my website logo to top left corner (0,0) and I dont want it push my container div down. I cant place logo tag within container tag because the logo overflows to left. if you couldnt picture it in your mind, please check the attached image thank you in advance. http://www.refinethetaste.com/html/ 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? 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! Hello; i'd like to ask you how to set the smiles of the images to the center of a container? please. my code as following; Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title>welcome to my page</title> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <style type="text/css"> #container { padding: 1px; border: 1px; width: 150px; background-color: lightblue; margin: auto; } #container p { padding: 0; margin: 0; text-align: center; } #smile ul { margin-left: 0; padding: 0; text-align: center; } #container li { display: inline; list-style: none; text-align: center; margin:0; padding: 0; } #container img { margin: 0; padding: 0; } </style> </head> <body> <div id= "container"> <p> smile </p> <ul id="sul"> <li> <img alt="h" src="honorhim.jpg" > <li> <img alt="c" src="cool.gif" > <li> <img alt="t" src="tongue.gif"> <li> <img alt="s" src="smile.jpg"> <li> <img alt="z" src="zall_coho.gif"> <li> <img alt="b" src="biggrin.gif"> <li> <img alt="con" src="cool.gif"> <li> <img alt="r" src="razz.gif"> </ul> </div> </body> </html> Hoping someone can help. I'm trying to figure out a way to align something to the left of an existing element within a container of variable height. The existing element is already aligned to the left edge of the container. To be more specific, I am trying to place a helper graphic to the left of the email text-field in the "Leave a Comment" form (not the "Email this Zing" form) on this page: http://www.zingfu.com/?zing=4419693e9e98f If it's possible to the place the helper graphic right next to the text field in the code, but then to break it out of the container div to move to the left of the text field, that would be great. Or if I could apply positioning to the helper graphic based on the positioning of the text field, that'd be fine too. But I'm not sure if either is possible. Little help? 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 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! Well I'm running into just a few difficulties trying to enclose a object inside of another container. The problem is that the container does not repeat the background when I lengthen the boxes within it. Can someone with a excellent CSS eye take a look at this and let me know what I'm doing wrong. I've played with overflow:auto; but the problem is that I need to set the width of the container at 990px, and it doesn't seem to work if I statically set the width. http://www.obelix.ca/templates/index.html Hi! Is it possible to align vertically block elements in a fixed-height (unknown) container? If not, this is a serious shortcoming of the css model of placing objects on the screen. Thanks! I'm trying to position a DIV on the right bottom side of the page using the following code: position:absolute; right:0; bottom:0; Unfortunately when I scroll down the page, the div remains in it original place :-( I have a logo which I would like always positioned at the bottom of a div. Does anyone know a way of achieving this? http://www.willisemail.co.uk/skill/ The logo is in the bottom right hand corner. Cheers Jemes /* Site Holder Start */ #box { width: 750px; margin: 0px auto; padding: 0px; text-align: left; border: 1px solid #979696; background-color: #FFFFFF; background-image:url(../Images/mid.jpg); } /* Site Holder End */ /* Site Holder Start */ #box2 { margin-left: 49px; margin-right: 50px; margin-top: 10px; margin-bottom: 10px; padding: 0px; text-align: left; background: #ccc url(../images/img_MainWhiteBg.jpg) repeat-y 50% 0; } /* Site Holder End */ /* Content Start */ #content { width: 461px; padding:0px; background-color:#FFF; overflow: hidden; } /* Content End */ /* Content Start */ #content2 { margin-left: 14px; margin-right: 15px; margin-top: 0px; margin-bottom:0px; padding:0px; background-color:#FFF; overflow: hidden; } /* Content End */ /*Right Menu Start*/ #right { width: 178px; padding:0px; float:right; background-color:#FFF; overflow: hidden; } #right2 { margin-top:0px; margin-left:14px; margin-right:14px; padding:0px; background-color:#FFF; overflow: hidden; } .RightMenu { margin-top:10px; padding: 0px; font-size: 13px; color: #6884AE; font-weight: bold; } .RightMenu ul { padding: 0px; margin: 0px; list-style-type:none; } .RightMenu li { background-image: url(../images/img_Li_Image.jpg); background-repeat: no-repeat; background-position: 0em; padding-top: 0px; padding-bottom: 0px; padding-right: 1px; padding-left: 14px; margin-top:5px; } .imgTitle { text-align:center; margin-top: 13px; margin-left:0px; margin-right:0px; } /* Right2 Menu End */ .imgRight { text-align:center; margin-top: 10px; margin-left:0px; margin-right:0px; border: 1px solid #979696; } .imgMain { text-align:center; margin-top:10px; border: 1px solid #979696; } .Menu { margin-top:10px; padding: 0px; } .Menu ul { padding: 0px; margin:0px; list-style-type:none; } .Menu li { display: inline; list-style-type:none; padding-top: 0px; padding-bottom: 0px; padding-right: 1px; padding-left: 0px; margin:0px; } .Main { padding:5px; border: 1px solid #979696; margin-top:8px; margin-bottom:10px; } .Cove{ margin-top:15px; text-align:center; } I want to be able to position an image at the very top of a cell/div/container/whatever and one at the very bottom. It's too bad there is no float:top and float:bottom. Something like this [HTML] <div style="background-color: red"> <img src="images/top.jpg" style="?" /> <img src="iamges/bottom.jpg" style="?" /> </div> [/HTML] I want a footer that's at the bottom of the page. If there isn't much content that means it should be at the bottom of the screen and there will be no scrollbars. If there is tons of content then it should show after the content and only be visible if the user scrolls to the bottom of the page. This code shows what I'm after and the problem I'm hitting. Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <title>title</title> <style type="text/css"> body, html {margin: 0; padding: 0; height: 100%} #top {background: red; position: absolute; top: 0px; left: 0px; height: 50px; right: 0px;} #content {background: orange; margin: 50px 200px;} #leftNav {position: absolute; left: 0px; top: 50px; bottom: 50px; width: 200px; background: yellow} #rightNav {position: absolute; right: 0px; top: 50px; bottom: 50px; width: 200px; background: cyan} #bottom {background:green; position: absolute; bottom: 0px; left: 0px; height: 50px; right: 0px;} </style> </head> <body> <div id="content"> Content<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /> </div> <div id="leftNav"> LeftCol </div> <div id="rightNav"> rightNav </div> <div id="top"> I'm at the top. </div> <div id="bottom"> I'm at the bottom. </div> </body> </html> Appreciate your thoughts. Hi guys, I am attempting to create a rather complex background, which needs to 'stretch' in a certain place. Here is my code; which currently works flawlessly in Firefox: CSS Code: body { margin: 0px; padding: 0px; height: 100%; background: #AAAAAA; } #cont { position: relative; margin: 0px auto; top: 20px; width: 760px; height: 800px; } #titlet { position: absolute; top: 0px; left: 0px; width: 742px; height: 9px; background: url(img/titlet.png); } #titletr { position: absolute; top: 0px; left: 742px; width: 17px; height: 9px; background: url(img/titletr.png); } #title { position: absolute; top: 9px; left: 0px; width: 742px; height: 164px; background: url(img/title.jpg); } #titler { position: absolute; top: 9px; left: 742px; width: 17px; height: 164px; background: url(img/titler.png); } #bgnd { position: absolute; top: 173px; bottom: 336px; left: 0px; width: 742px; background: url(img/bgnd.jpg); } #bgndr { position: absolute; top: 173px; bottom: 336px; left: 742px; width: 17px; background: url(img/bgndr.png); } #clouds { position: absolute; left: 0px; bottom: 17px; width: 742px; height: 319px; background: url(img/clouds.jpg); } #cloudr { position: absolute; left: 742px; bottom: 17px; width: 17px; height: 319px; background: url(img/cloudsr.png); } #cloudb { position: absolute; left: 0px; bottom: 0px; width: 742px; height: 17px; background: url(img/cloudsb.png) no-repeat; } #cloudbr { position: absolute; left: 742px; bottom: 0px; width: 17px; height: 17px; background: url(img/cloudsbr.png) no-repeat; } HTML Code: <body> <div id="cont"> <div id="titlet"></div><div id="titletr"></div> <div id="title"></div><div id="titler"></div> <div id="bgnd"></div><div id="bgndr"></div> <div id="clouds"></div><div id="cloudr"></div> <div id="cloudb"></div><div id="cloudbr"></div> </div> </body> The problem relates to the 'bgnd' and 'bgndr' values. I have combined 'top' and 'bottom' to have the backgrounds tile in exactly the right place between the other div elements. Is there a hack that can allow me to use this method in IE? Ok I have two layers positioned on the bottom left and right of my page as you can see here.. The problem is when I resize the page the two layers move up with it and then if I use the scroll wheel they dont go back to the bottom and they stay where they are. Anyone know how I can get it so if I were to resize the page the two elements would stay at the bottom. I tried that footer demo that everyone posts the link for but I couldnt get it to work for the case I have. Anyone have any ideas? Thanks , appreciate any help you can give me. |