CSS - Css Position Problem (bottom Space)
Similar TutorialsI am presently creating a website for a friend of mine who's a model and wants her own website, I have decided to make it using xhtml and css. The problem that I am having is that I would like to have a footer which is at the very end of the page no matter how much content there is to the page. I have uploaded the code to here When this page is viewed in IE the footer is displayed at the bottom of the screen although the content carries on after the footer. When this page is viewed in Firefox the footer is displayed just below the bottom of the screen although again the content carries on after the footer. I have Googled this and tried out a couple of the suggested ways of getting the page to work and it just doesn't appear to want to work, so I am obviously doing something wrong :s Does anyone have any idea how I would be able to get the footer to stay at the very bottom of the webpage? Also if you look at the website you will see that the navigation sidebar only goes down as far as its content, I would prefer it if the sidebar went down to the footer (which will hopefully be at the bottom of the webpage). Again does anyone have any idea how I would be able to get it to do this. 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 :-( Hello, I am new to the css world, however I have followed some tutorials and became familiar with how to use css. However now I am trying to remove the space on top and bottom of an image, so that I bring two images one on top of each other. Here I placed some sample html code: Code: <html> <head> </head> <body> <div> Some text BEFORE the line. </div> <div> <img src="line.gif" width="100%" height="4px" /> </div> <div> <img src="line.gif" width="100%" height="4px" /> </div> <div> Some text AFTER the line. </div> </body> </html> As you can see in the above code, I have a div tag with the text above, a div tag with an image line, another div tag with an image line, and some text below. However there is a space of around 5px from one line to another. I tried to do the css syntax for the image as follows: Code: img { border: 1px solid #000000; margin-top: 0px; } However I can see the border on the image, but the space still remains there. I also tryied to use the padding-top, but it still did not work Is there anyone here that can help me out please? thanks & regards, sim085 I'm having a weird quirk happening at the bottom of a page I am developing. There is extra space, maybe 80-100px of it, showing up at the bottom in my container div (which I have id'd as "reality"). Can anyone suggest what might be shoving all that extra space in there? html page: http://www.iainhamp.com/reality/hyborianwar.html css page:http://www.iainhamp.com/reality/reality_hyborian.css Thanks for any help you can provide. - iain 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. Hello, i created a site called knowledgeocity.com and it looks fine in Firefox, but in IE7, there is extra space at the bottom between the logo on the right side and the footer, does anyone know how to fix that? I tried margin bottom, but did not work. thank you i have a page where i float a block of text to the right. at the bottom of that text, there is a graphic that creates a footer for that block. in ie, it looks fine. but in firefox it's got 12px of space below the text (as opposed to ABOVE the graphic.) because it looks incorrect in ff and ok in ie, my hunch is that i've done something wrong - since ff is so much more reliable than ie. two last things. when i place a 1px border at the bottom of the text, the bottom margin disappears. but if i use a 0px border, the space remains. also, if i remove the <p> tags from within the text, the problem resolves itself. i do not address p formatting within the css document. this is my html: Code: <div id=outerwrapper> <div class=sidebar> <div id=sidebartext style="background: #acba6e url(images/sidebarbg.gif) 0px 0px repeat-y;"> <img src="images/image1.jpg" align=right> Some text. <p> <em>Some text</em> </div> <div class=sidebarbottom> <img src="images/image2.png"> </div> </div> <div class="maincontent"> <h1 style="text-align: right; line-height:120%; border-right: 30px solid #ffffff;">Some text</h1> More text <p> 123 Main Street, Your City, USA 512.555.1212 </div> </div> and this is my css: Code: html, body{ margin:0; padding:0; border:0; font-family: "arial"; font-weight: normal; font-size: 12px; line-height: 210%; color: #847c69; letter-spacing: .05em; } body { text-align: center; } #outerwrapper { position: relative; top: 192px; left: 0px; margin-left: 45px; margin-right: 45px; display: block; overflow: visible; zoom: 1; z-index: 1; } .sidebar { margin-right: -27px; float: right; width: 305px; display: block; z-index: 1; } #sidebartext { width: 265px; padding: 0px 20px 0 20px; font-family: "arial"; font-weight: normal; font-size: 12px; line-height: 130%; color: #ffffff; text-align: left; letter-spacing: .05em; z-index: 1; margin-bottom: 0; } .sidebarbottom { margin-top: 0; width: 305px; z-index: 1; } .maincontent { padding: 10px 30px 30px 30px; background: #ffffff; text-align: left; border-right: solid 1px #666688; border-bottom: solid 1px #666688; z-index: 1; color: #6c6b5e; } i would appreciate any help you can provide. this has stolen hours from my day. I have 2 div .In top div i have menu.In bottom div i have iframe . i want that top div should take about 20 % space and bottom div take rest of the space .iframe refresh every min and it content changes everytime .Currently scrollbar are appear both horizontally and vertically . How can i remove this scrollbar. I give a sample code <body class="body"> <div class="container"> <div class="top"> some contents here </div> <div class="bottom"> <iframe class="iframeclass></iframe> </div> </div> </body> how i design this classes The content of iframe is dynamic its height change everytime page refresh. I can't seem to work out where the huge space at the bottom of the pages are coming from. This is the test page http://midnighttempest.com/layouttest.html as you can see at the bottom of the page there is a huge gap under the text which i can't get rid off. Anyone help? The website I created has a large blank space at the bottom. I want 30px between the bottom and the layout. At the top, I could create the space I want. Margin-bottom: 30px doesn't do the trick. I tried so many things but I just can't get it fixed. I think something is set too height or something? If someone could figure it out, I would be forever grateful! You can check out the site and css he I can't post the url because I'm a new user Can a mod post my url? EDIT: I have set the url as my homepage in my profile! Just click my username to check out the site. Thanks for taking the time to read my question. I have 16 pictures on my page. In FF I have no extra space under each picture and in IE6 I do. Why? In IE you can see the container color (the non Orange colors) but in FF you don't. I've tried a bunch of stuff but can't figure it out. http://stuccotech.bravehost.com/ CSS: Code: html, body { height: 100%; width: 100%; margin: 0px; padding: 0px; background-color: #000000; background-image:url(MainBackground.jpg); background-repeat: no-repeat; background-position: top center; } .TheFrame { height: 20px; width: 20px; background-color: white; float: right; } .MainContainer { width: 646px; height: 549px; background-color: #3f3f3f; overflow: hidden; padding: 0px; margin: 0px auto; background-image:url(BehindLogo.png); background-repeat: no-repeat; background-position: top left; } .LogoArea { height: 200px; width: 200px; /*background-color: white;*/ float: left; margin: 0px; padding: 0px; display: inline; } .Logo { float: left; height: 120px; width: 240px; padding: 0px; margin: 0px 0px 0px 2px; display: inline; background-image:url(LogoWithText.png); background-repeat: no-repeat; background-position: top left; } .NavBarMain { background-color: #966200; height: 120px; width: 370px; float: right; margin-right: 20px; margin-top: 10px; padding: 0px; display: inline; } .NavBarContent { background-color: orange; height: 90px; width: 370px; float: right; margin: 0px; margin: 30px 0px 0px 0px; padding: 0px; } .TextBox1 { float: left; margin: 5px 0px 0px 10px; padding: 5px; width: 190px; height: 305px; overflow: hidden; display: inline; } p.MainText { color: white; font-size: 14px; } p.MainText:first-line { text-indent: 5px; } .ContentText { color: white; font-size: 14px; } .PortfolioHolder { width: 414px; height: 365px; float: right; margin: 25px 20px 0px 0px; padding: 0px; display: inline; background-color: orange; } .MainPictureFrame { width: 414px; height: 318px; float: right; margin: 0px; padding: 0px; /*display: inline;*/ background-color: red; } .PortfolioPicture { width: 414px; height: 318px; } .PicInfoContainer { float: left; width: 414px; height: 47px; color: white; font-size: 12px; } .SubPictureFrame { width: 96px; height: 72px; margin: 10px 0px 0px 10px; padding: 0px; float: left; background-color: yellow; } .SubPictureFrameFirstRowFirstColumn { width: 96px; height: 72px; padding: 0px; margin: 0px; float: left; background-color: purple; } .SubPictureFrameFirstRow { width: 96px; height: 72px; padding: 0px; margin: 10px 0px 0px 0px; float: left; background-color: blue; } .SubPictureFrameFirstColumn { width: 96px; height: 72px; padding: 0px; margin: 0px 0px 0px 10px; float: left; background-color: aqua; } .BottomNavContainer { width: 550px; height: 14px; float: right; margin-right: 40px; margin-top: 10px; } .BottomNavHolder { float: right; } .BottomNav { font-size: 12px; height: 14px; margin-right: 20px; float: left; } .PortfolioListContainer { float: left; width: 204px; height: 250px; overflow: auto; display: inline; background-color: #5f5f5f; margin: 0px 0px 0px 5px; padding: 0px; border-top: 1px #ffffff solid; } .ListItemHome { float: left; width: 76px; height: 20px; padding: 0px 0px 0px 4px; margin: 0px; border-right: 4px solid white; } .ListItemBuilding { float: left; width: 110px; height: 20px; padding: 0px 0px 0px 4px; margin: 0px 0px 0px 80px; border-left: 4px solid white; display: inline; } .ButtonContainer { float: left; display: inline; background-color: aqua; width: 204px; height: 30px; padding: 0px; margin: -5px 0px 0px 5px; } .HomesButton{ border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-right: 4px solid white; width: 80px; height: 30px; margin: 0px; float: left; } .CommercialButton{ border-width: 0px; width: 120px; height: 30px; padding: 0px; margin: 0px; float: left; } a.BottomNav:link { text-decoration: none; color: #D3D3D3; } a.BottomNav:visited { text-decoration: none; color: gray; } a.BottomNav:hover { text-decoration: underline; color: white; } a.BottomNav:active { text-decoration: none; color: white; } a.ContentText:link { text-decoration: none; color: #D3D3D3; } a.ContentText:visited { text-decoration: none; color: gray; } a.ContentText:hover { text-decoration: underline; color: white; } a.ContentText:active { text-decoration: none; color: white; } a.ListItemHome:link { text-decoration: none; color: #D3D3D3; } a.ListItemHome:visited { text-decoration: none; color: #D3D3D3; } a.ListItemHome:hover { text-decoration: underline; color: white; } a.ListItemHome:active { text-decoration: none; color: white; } a.ListItemBuilding:link { text-decoration: none; color: #D3D3D3; } a.ListItemBuilding:visited { text-decoration: none; color: #D3D3D3; } a.ListItemBuilding:hover { text-decoration: underline; color: white; } a.ListItemBuilding:active { text-decoration: none; color: white; } Thanks, Brad Hi! I"m wondering how do I prevent the <div> tag from introducing a line break in the web browser immediately after the closing <div> tag, or </div>.... <span> doesn't do that.... Read the article that <div> is a block elements where <span> is a inline element. So, the block element is what introduce a line break before and after the tag, just like the <p> tag for example... Hello Trying to position an image at the bottom of my webpage which: a) will always stay at the bottom of the page regardless of length (page length not window height so the position: fixed is not quite what I'm looking for) b) will not slide on top or under divs on my page (what position: absolute does) but instead stop moving up once it reaches content above it and the scrollbar appears (as tables do) c) I can layer divs on top of so far this is as close as I've got: in the html <!-- container for site info --> <div id="container"> <!-- other content in divs here --> <!-- other content in divs here --> <!-- footer for bottom image --> <div id="footer"> <!-- footer details, who / when / copyright --> <div id="footerdetails"> details here </div> <!-- footer details, who / when / copyright --> </div> <!-- footer for bottom image --> </div> and in the css #container { position: absolute; top: 0px; width: 750px; height: 100%; } #footer { position: absolute; bottom: 0px; height: 230px; width: 750px; background-image: url(../images/footer.jpg); background-repeat: no-repeat; background-position: bottom left; } #footerdetails { position: relative; margin: 0px 0px 0px 0px; padding: 9px 0px 10px 70px; top: 195px; width: 680px; text-align: left; voice-family: "\"}\""; voice-family:inherit; } I know I'm sort of answering my question above (tables) but I've seen this done with divs, just can't get the right combination of css - anyone have any ideas on this? Thanks in advnace. a+ gar 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 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. |