CSS - Fixed Position With A Minimum Height
Hello!
I'm working on a website right now and have sort of dived in further than I understand conditional CSS. The website is he www.kekoz.com I have that little menu in the upper right and the info in the lower right. I like those being fixed so when the user scrolls they are always up there. But I can't figure out how to make them stop from colliding with the main pictures when you change the height of the page. Any help would be grand! Right now they're position super simple: Code: #links{ position:fixed; top: 20px; right:20px; width:300px; } Code: #info_box{ position:fixed; bottom: 25px; right:10px; width:550px; } I tried to set a minimum height on them, but I think that would have to do with some sort of a container around them. Or maybe I'm just going about it all wrong. Also a couple other things I'm sort of thinking. I would like the "Scroll this way" thing to always be centered between the lower edge of the pictures and the bottom of the window. Not %100 sure how to get that set up. And the last thing I'm thinking for this page, which I'm not sure is all CSS would be to have the "scroll this way" thing actually fade based on the scroll position. I think this might be Jquery but thought I'd throw it out there to see if anyone had any advice. Similar Tutorialsi was trying to position what should have been a square of 5px by 5px on the screen, but ended up with a rectangle with a width of 5px but a height of what looked like at least 10px ! all margins + paddings had been set to zero, so that wasn't the reason in the end i managed to draw a square by adding : Code: max-height: 5px; overflow: hidden; to the div's style it still puzzles me though : does a <div> element have a default minimum height ? Hello all, I'm trying to find a solution for the problem hereafter : I'm building a css2 based website where all thelayout is controlled in the CSS. I have in my website a main "body" box identifier by a CSS ID. This "body" is a container for various articles. It has a background and borders. I would like this "body" box to have a minimum heigth so that even if the content (ie the article) is made of two lines, the background and the borders have this minimum size. The problem is that if i use the "heigth" attribute in my CSS id, when the content is longer for that heigth, the box is not extended, only the text, going out of the box. To summarize, i'm looking how to fix a minimum height to a DIV or any block component of a css, without limitating this block to this only height. I hope i have beel clear, if any of you have an idea for this, it would be very helpfull to me, as this is a very recurrent problem. Thanks by advance How can I fix a Div a set distance below another Div without a set height? I'm a newbie to css. I'm trying to convert tables to css and having a bit of a tough time. Latest problem - create a window or container with a one line border with minimum height, say 600px, but the height will expand as the content grows. Any help? Thank you kindly! I was experimenting this weekend with some CSS 'page-sculpting', using small divs to make shapes, etc. I used FireFox as my testbed and of course everything went smoothly. I switched over to IE6 and saw that every div had a minimum height-it looked like 1em. I specified height and width on all <div>. Some used borders, some did not. An example would be: PHP Code: <div style="height:2px; width:3px; background:green" ></div> Has anyone else come across this or know of a fix? I haven't tried <span> or other tags (I will...just thought of that), tho I suspect they'll behave the same. Any help appreciated. NotGoddess ok my site works perfect in ffox but when i load it in ie the fixed position dose not work :'( why not?, if i go back in firefox it will Since position:fixed does not work in IE, are there any other ways to achieve the fixed effect, without using javascript? i am trying to do this example here w3schools.c0m/css/tryit.asp?filename=trycss_position_fixed the o, in .com has been changed to 0 so i could post. sorry the text " Some more text " I wish to had dead center on the right side of the page, not near the top like that, mainly, i wish to put two more lines of text just under it as well, all being dead center of the page, on the right, i cannot figure it out, any help please? The layout in question: Page: http://www.westeros.org/ASoWS/index-Frames.html CSS (general): http://www.westeros.org/ASoWS/ASoWS-All-Frames.css CSS (IE): http://www.westeros.org/ASoWS/ASoWS-IE.css In Mozilla the above CSS 'frames' layout is mostly working, save that I can't figure out a way to hide the text above the header and below the footer. Is that at all doable with this layout? In IE, however, the header, footer and sidecolumns are all over the place. I have another CSS 'frames' layout (see the links below), which does work in IE, and part of the problem with the new layout seems to be that IE really doesn't like having left and right values specified for the header and footer. However, without those, I don't know how to make sure that they start and stop 10px away from the edge. Any workarounds for that that anyone can think of? Old CSS 'frames' layout (does work in IE): Page: http://www.westeros.org/BoD/ CSS (general): http://www.westeros.org/BoD/BoD-All.css CSS (IE): http://www.westeros.org/BoD/BoD-IE.css Please look at this URL http://www.finance.samif.com/Koelkast When I select any check box on left column then one pop up is display on screen. This image shows properly in Fire fox. When I scroll up down then image is fixed in fire fox. Vertically and Horizontal But when I used IE and select check box on bottom left menu then I can't see pop up image. Because this is not display vertically middle or it is not fixed. Please give me idea or suggestion how I can fix it. Thanks I'll start with my code. code:--------------------------------------------------------------------------------<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Untitled Document</title> <style type="text/css"> body { height: 100%; width: 100%; overflow: hidden; margin: 0px; padding: 0px; } #menu { position: absolute; display:block; bottom:0px; left:0px; width:100%; border:1px solid #002E80; background-color: #E5EFFF; } #content{ padding: 5px; width: 100%; height: 100%; overflow: auto; z-index: 100; } </style> </head> <body> <div id="content"> Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. </div> <div id="menu"> <table width="100%" border="0"> <tr> <td><div align="left"> <input type="button" name="prevBut" value="<< Prev" /> </div></td> <td><div align="right"> <input type="button" name="nextBut" value="Next >>" /> </div></td> </tr> </table> </div> </body> </html> -------------------------------------------------------------------------------- The problem falls on the positioning of the scrollbar. I need it to be over my bottom menu. Right now it falls below the menu. Why is this? Hi all, I've got a site which you have to scroll horizontally to view the content (different eh?), but I want the menu to stay in a fixed position on the left side of the screen. Can anyone tell me if/how I can do this? Cheers! I have a scrolling div on a page. Within the div is a tabular form. I want to place a button that is has a fixed position within the div. So if the HTML code is like this: Code: <div id="div1"> <div id="buttonID"></div> <form> <table> <tr> <td> </td> </tr> </table> <form> </div> The css I thought would achieve what I wanted is Code: #div1{ div1 CSS goes here. } #div1 #buttonID{ position: fixed; top: 300px; left: 20px; } However, while the button is fixed, its position is fixed in relation to the page, not within the div which is annoying. Can anyone point out what I'm doing wrong here? Can a sumbit button for a form be located outside the form or does it matter? Hello all i am having trouble with getting a layer to stay put when i school down the page. This is my code: Code: #Layer1 { position:absolute; width:64px; height:73px; z-index:1; left: 0px; top: 101px; } <div id="Layer1"> <div align="left"><img src="images/gun.gif" width="58" height="73" /></div> </div> Everytime i scroll down the image goes with it. I need it stay where i put it without moving at all. If anyone could help then that would be great David Hi All, I have been working on this validated site - http://www.edgeandbarrett.com/zub/test2/logo.htm and it works on all browsers, mac and pc, all apart from IE7 (and 6 of course with fixed). When viewing it, on ie7, it seems the padding is not being read, so the fixed navigation, is overlapping my content. This is the css - Code: * { margin : 0; padding : 0; } img { display : block; border : 0; } body { background-color : #eeeeee; font-family : helvetica, arial, sans-serif; line-height : 18px; } hr, .hide { position : absolute; top : 0; left : 30px; } #site { width : 870px; margin : auto; } #header { position : fixed; display : inline; height : 100%; width : 200px; top : 30px; background : #eeeeee; z-index : 4; } #logo { position : relative; top : 10px; z-index : 5; } .picbar { position : relative; padding-top : 5px; padding-bottom : 5px; margin-top : 22px; margin-bottom : 12px; border-top : 1px solid #9f9f9f; border-bottom : 1px solid #9f9f9f; z-index : 6; } .menu { position : relative; width : 190px; z-index : 7; } .menu .title { font : bold 13px Georgia, "Times New Roman", Times, serif; color : #333333; padding : 5px 0 5px 0; } .menu .title a { text-decoration : none; color : #333333; } .menu .title a:hover { text-decoration : none; color : #940f04; } .menu .title a:visited { text-decoration : none; color : #940f04; } .menu ul { list-style-type : none; } .menu ul li { padding-bottom : 2px; } .menu ul li a { font : normal 12px Arial; color : #333333; padding : 7px 0 7px 0; line-height : 17px; text-decoration : none; } .menu ul li a:visited { color : #940f04; } .menu ul li a:hover { color : #940f04; } .menu h1 { padding : 5px 0 5px 0; font-family : Georgia, "Times New Roman", Times, serif; font-size : 13px; color : #333333; } .menu a { color : #333333; text-decoration : none; } .menu a:hover { color : #940f04; } #container { position : relative; background-color : #fff; width : 650px; margin-left : 220px; padding-top : 90px; z-index : 3; } #container h1 { padding-bottom : 10px; padding-bottom : 10px; font-family : Georgia, "Times New Roman", Times, serif; font-size : 13px; color : #333333; } #container h2 { padding-bottom : 10px; padding-bottom : 10px; font-size : 13px; color : #333333; } #container p { padding-bottom : 10px; font-size : 13px; color : #333333; border-bottom : 1px solid #9f9f9f; } #container a { color : #000; text-decoration : none; } #container a:hover { color : #940f04; } .pic { padding-top : 5px; padding-bottom : 5px; margin-bottom : 18px; border-top : 1px solid #9f9f9f; border-bottom : 1px solid #9f9f9f; } .text { background-color : #fff; width : 420px; padding-bottom : 30px; font-size : 13px; color : #333333; } .about { background-color : #fff; width : 420px; padding-bottom : 30px; margin-bottom : 20px; font-size : 13px; color : #333333; border-bottom : 1px solid #9f9f9f; } .ser { background-color : #fff; float : left; width : 210px; padding-bottom : 15px; font-size : 13px; color : #333333; } .ser2 { background-color : #fff; float : left; width : 210px; padding-left : 8px; padding-top : 47px; padding-bottom : 15px; font-size : 13px; color : #333333; } .test { background-color : #fff; width : 420px; padding-bottom : 30px; font-size : 13px; color : #333333; } .line { background-color : #fff; float : left; width : 420px; padding-bottom : 15px; margin-bottom : 20px; border-bottom : 1px solid #9f9f9f; } #footer { position : relative; background-color : #fff; width : 650px; margin-left : 220px; padding-top : 20px; padding-bottom : 20px; border-top : 1px solid #9f9f9f; z-index : 1; } #footer p { font-family : Georgia, "Times New Roman", Times, serif; font-size : 12px; color : #505050; text-align : left; } #footer a { color : #505050; text-decoration : none; } #footer a:hover { color : #940f04; } I have no idea the fix, have tried display:inline; and had a look around, but am not sure what the exact problem is, and am quite new so all a bit confusing. Any help would be really useful!!! i have also uploaded 2 screenshots. one how it looks on all other browsers . . . and one on IE7!!! http://www.edgeandbarrett.com/zub/test2/how%20it%20should%20look.png http://www.edgeandbarrett.com/zub/test2/ie7.png Its the only issue i have before i can complete site . . . . . . and really want to crack on!!!!!! Thanks, Orwel Hello, Is there a method by which we can use position:fixed in Internet Explorer 5.5 and 6.0 ? I have searched google but did not find anything really useful. Please help me. I have seen this done but can't find any examples at the moment, but what I am looking to emmulate is have a page that required vertical scrolling. On either the left or right hand side is (for example) a square image and directly below it is a menu. When the user scrolls down the page the image goes off the top but the menu sticks to the top so is always visable. When the user scrolls back up as soon as the image starts to appear it pushes the menu back down so it is sat below the image. If i used position:fixed I can keep the menu in the same place when scrolling but I would like it to rise to the top of the browser when space is availble when scrolling. Make sense? I've created a website that uses position:fixed and would like to add a feature detector that would redirect users with incompatible browsers to an update page. I've been searching the web and haven't found any conclusive solutions specific too position:fixed and with redirection. Could anyone help? Thanks. I'm working on a site with a div element with a fixed position, some 800 pixels from the left. The site is optimized for 1024x768. However, if a user with a resolution of 800x600 views the page, this div element will be missing, and the user won't be able to scroll over to see it. Is there some way I can get around this? One idea would be to align the div on the right instead of the left, but I don't want a lot of whitespace between my content (on the left) and my div (on the right). I was hoping that I could specify a parent element with a relative position, and that position: fixed would reference the position of the parent element, but that only seems to work when the child div element is position:absolute, not position:fixed. Thanks for any insight. I have a web page with three columns. The column on the right is the menu column which i want to keep in a certain position even when the user scrolls down. I know how to do this using css, but the problem is that if the resolution changes so does the position of the column. Is there a way to fix the position only from the top of the browser window and use the center column (or container that holds the 3 columns) for the horizontal alignment? Thanks in advance |