CSS - Fixed Header Div Help! <--part Of The Page Content Is Scrolling Over The Fixed Header
Hi all,
I need some help. I have implemented a fixed header on my site, but certain content is scrolling above the header while other is scrolling behind. I would like it all to scroll behind the fixed div's. Similar TutorialsI have a fixed top header and menu with 20% height and 19% width respectively. I can not get the content to scroll under the header or have the footer to be scrolled at the bottom of the content along with it. Code: .content { position: relative; top: 20%; left: 19%; width: 80%; height: 75%; background-image: url("image.jpg"); } #footer { position: relative; text-align: center; left: 19%; width: 80%; height: 5%; top: 95%; background-color: grey; } hi I have a simple page which has a horizontal header along the top which is fixed using CSS, and below the rest of the page scrolls underneath this header. However I've noticed when using anchor points, that it aligns to the top of the screen (but underneath the top header). So when I click a link to go to an anchor point the top part of what I wanted to see disappears under the top header. How would this be fixed? cheers nathan Hi, I have a table with a scrollbar that works perfectly in ie but not in mozilla. When I scroll up/down in mozilla, the header is not kept fixed as it should be. I use a div that encloses one table with the content. the css code for the div and the thead: Code: div.tableContainer_plegado{height: 285px; overflow: auto; width:100%;} //I also tried top:0, just in case mozilla doesn't support the expression element thead.lista td{position:relative; top: expression(document.getElementById("data").scrollTop-0);} thanks in advance!! Hello all, still a little new to css layout problem-shooting in older browsers, so thanks for your help in advance! I'm having a problem which is only occurring in Internet Explorer 6, but I just can seem to figure out what's wrong. if you look at the page in any other browser, you can see the header <div> stretches the width: 100%, but in IE6, the header <div> does not extend all the way to the left, but rather starts where the margin:auto Main <div> tag starts from the left side. What I am lost on is that the footer <div> performs this just fine, but it's position is not fixed and there is no z-index. here is the code for both, and thanks again for having a look: #header { width: 100%; height: 107px; display: block; position: fixed; margin: 0px; padding: 0px; background-color: #000000; background-image: url(../images/main/bhs_design_header_gradient.jpg); z-index: 100; } #footer { width: 100%; height: 35px; display: block; background-color:#000000; margin-top: 10px; clear: both; text-align: center; font-family: Arial, Helvetica, sans-serif; font-size: 11px; font-weight: bold; color: #EBEAE8; margin: 0px; background-image: url(../images/main/bhs_design_footer_gradient.jpg); } I've mocked up a page using 960.gs that has has several elements fixed in a div under which the content of the of the page is to flow. The background of this div is a CSS gradient, and has a height of 100% (if the gradient is applied to to the actual body of the page it doesn't actually extend the whole width of the page). As the user scrolls up, the content is to be viewable behind an opaque menu. bit.ly/f2a4rC The layout works as I want in FF and Chrome, but the content of the page scrolls over the fixed upper area in IE7. I understand that a new stacking context is being created, but I've been unable to resolve this by fiddling with the z-index of the elements in question, or their parents. I know I can consolidate some of the extra divs used by the grid, but I've been unable to do so in a way that keeps the gradient and transparency effects. How can I achieve this look in IE7? Hello, im trying to make Fixed width 3 columns (each column have fixed width) layout 100% height with header and footer. -Well I see alot of examples around the web, but i dont see complete one and im really tired of searching, i made the Fixed width 3 comlumns layout, left and right are absolute position, and center is relative to the header -the problem is that all columns dont fill the whole height of the browser windows, the footer doesnot work good. so the whole thing is missed up, so please show 100% working example of what i need. Thanks in Advanced Samer I'm attempting to get a page that has a header, footer, left navigation bar with a fixed width, with a right "fluid" content section. I can get it to work by giving the main content a "margin-left" of the width of the navigation panel, and absolutely positioning the navigation. Problem is, with the navigation being absolutely positioned, it takes it out of the flow and doesn't push the container to fit its contents. I've trying playing with using floated divs, which is I'm sure the way I'll have to go, but I want the navigation bar to always be a fixed width of 175px, and I want the content section to stretch to fill the remaining space. I'd also like to make sure the content portion appears BEFORE the navigation panel in the order it appears on the HTML for SEO purposes. I'm sure it's easy using Javascript, but I'd like to do a pure CSS solution, if possible. How do I do that? Here is the link if you want to have a look: http://www.chcs-ut.com/support.php?section=technical http://cheers-sendai.com/fluidframe.htm has a great and simple example of 3 cols (OK, 2 cols in the middle section makes "4 cols"), header and sticky footer, where the middle col has overflow:auto so it can be scrolled. GREAT example, I think (due to the use of bg colors, etc.). The left/right/width values of the divs are manipulated so that the middle section runs from 10% to 90% and the left/right divs fill in accordingly. I'd like to be able to set, for example, the left and right divs to be 150 px wide (NO percentages!) and have the middle section stretch between them (regardless of viewport width) and be able to be scrolled, too. The problem I see is that most examples use percentages. I can set the left div to be a fixed width, then set the middle section left coord. to be, say, 150px, but then I need to set its width to stretch to "150 to the left of the right side of the viewport" and I don't know how to do this. Thanks. 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, I'm new here and in desperate need of your help. What I'm trying to accomplish is this: http:// i29.tinypic.com/259inue.jpg There are two problems. 1) How do I place two sidebars next to each other? 2) How do I keep the header and the sidebars fixed, and the content the only element that you can scroll in? Any hints would be greatly appreciated! Sorry about my Engish, I'm afraid it's not very good. I have stumbled onto two issues with my layout. I have a fixed footer and I have my three columns and the problem I am having is that the content hides behind the fixed footer which is what I want. However when the content is just not enough it gets clipped behind the footer and what I'd like is to have i scroll up to the top of the footer in that situation. How would I do that in my css? The second issue is that when I have a lot of content it breaks out of the container div or at least it appears that way. I'd like it to push the columns down inside the container as needed. The css and xhtml arevalid. Here is the link: http://www.lonniebruhn.com/sitelab/ Thanks for your help LB Hi All, I am experementing with a fixed watermark image/background on my webpage.The code worked fine to prevent the image from tiling however when I scroll the whole lot goes as well,the table of rolovers and the header image. I need a code to keep the table of javascript and the image fixed while only the text scrolls. Also as you will see the bg image takes up the whole page which results in the text scrolling over the entire height of the page.Is there any code I can apply to make a cut off point for the text,for appearance sake lets say the top bar of the image .Here is the url of the page I am working on. Thanks URL How can I fix a Div a set distance below another Div without a set height? Hi folks, I'm working on a website at the moment and having some issues 'fixing it' for Internet Explorer. The design scrolls horizontally, and using 'position:fixed;' on certain elements keeps them on the page while the rest scrolls - this works fine in Safari / Camino / Firefox etc. but as we know position:fixed; is broken in IE. I tried applying the fix found at http://web.tampabay.rr.com/bmerkey/...tion-fixed.html but this only seems to work for regular vertical scrolling pages - when scrolled horizontally the "fixed" elements still scroll with the page. Is there any way possible to get this to work? I really really want to avoid any of those javascript "jumpy" scripts to reposition the element all the time. Thanks all. I've got a problem with my css. It consists of 1 header {header} 2 navigation divs {navigation/extra} 1 content div {content} and 1 footer {footer} the 2 content divs have fixed widths (200px) and the content needs to be able to stretch the rest of the window. easy? Yea i thought so, but i can't get it working, if i set the content div to a % and the window resizes it all stuffs up... there has to be a way around this? I guess i need the syntax for 100%-200px. below is the code Code: html,body{margin:0;padding:0} body{font: 76% arial,sans-serif} p{margin:0 10px 10px} a{display:block;color: #981793;padding:10px} /* Layout */ div#header h1{height:80px;line-height:80px;margin:0; padding-left:10px;background: #EEE;color: #79B30B} div#content p{line-height:1.4} div#navigation{background:#B9CAFF} div#extra{background:#FF8539} div#footer{background: #333;color: #FFF} div#footer p{margin:0;padding:5px 10px} div#wrapper{float:left;width:100%} div#content{float:right;position:absolute;margin-left:200px;width:100%} div#navigation{float:left;width:200px} div#extra{float:left;clear:left;width:200px;} div#footer{clear:both;width:100%; position:fixed} Hello, How can i create a fixed-width menu to the left with content to the right that fills up the rest of the page. ie, no auto-width, it needs to fill up all the way to the right edge. So if you create a horizontal line <hr> in the content it will draw all the way to the right (except for some padding of course) Like this pictu tinyurl.com/ydsr2ov In the HTML below I use divs contentleft, contentcenter and contentright. Because the text under the Header Contentright is so long I would like to make a scrollbar for the text of contentrigth but withoud the Header contentrigth, so that you alwaus see the header when scrolling the text. Is this possible with these content-codes? This is the HTML I have so far: Code: <head> <meta http-equiv="content-type" content="text/html;charset=iso-8859-1"> <meta name="generator" content="Adobe GoLive 4"> <title>glish.com : CSS layout techniques : static width and centered</title> <style type="text/css"><!-- #contentcenter { background-color: #eee; float: left; padding: 0px; width: 300px } #contentheader { background-color: #fff } #contentheader h1 { font-size: 14px; margin: 0px; padding: 16px } #contentleft { background-color: #fff; float: left; padding: 0px; width: 175px } #contentright { background-color: #fff; float: left; padding: 0px; width: 175px } #contentright p { font-size: 14px } #toptext { text-align: left; margin-top: 10px; margin-right: auto; margin-left: auto; padding: 0px; width: 650px } body { text-align: center } h1 { font-size: 14px; margin: 0px 10px 10px; padding-top: 10px } p { margin: 0px 10px 10px }--> </style> </head> <body> <div id="toptext"> <div id="contentheader"> <h1><a href="home.asp">Top Text</a>, page with three columns: left, centered, right.</h1> </div> <div id="contentleft"> <h1>Header Contentleft</h1> <p class="greek">This is the left column</p> </div> <div id="contentcenter"> <h1>Header Contentcenter</h1> <p>This is the center column</p> </div> <div id="contentright"> <h1>Header Contentright</h1> <p>This is the right column. Bla bla bla bla bla Bla bla bla bla bla Bla bla bla bla bla Bla bla bla bla bla Bla bla bla bla bla Bla bla bla bla bla Bla bla bla bla bla Bla bla bla bla bla Bla bla bla bla bla Bla bla bla bla bla Bla bla bla bla bla. Bla bla bla bla bla Bla bla bla bla bla Bla bla bla bla bla Bla bla bla bla bla Bla bla bla bla bla Bla bla bla bla bla Bla bla bla bla bla Bla bla bla bla bla Bla bla bla bla bla Bla bla bla bla bla Bla bla bla bla bla Bla bla bla bla bla Bla bla bla bla bla Bla bla bla bla bla Bla bla bla bla bla Bla bla bla bla bla Bla bla bla bla bla Bla bla bla bla bla Bla bla bla bla bla Bla bla bla bla bla Bla bla bla bla bla Bla bla bla bla bla. Bla bla bla bla bla Bla bla bla bla bla Bla bla bla bla bla Bla bla bla bla bla Bla bla bla bla bla Bla bla bla bla bla Bla bla bla bla bla Bla bla bla bla bla Bla bla bla bla bla Bla bla bla bla bla Bla bla bla bla blaBla bla bla bla bla Bla bla bla bla bla Bla bla bla bla bla Bla bla bla bla bla Bla bla bla bla bla Bla bla bla bla bla Bla bla bla bla bla Bla bla bla bla bla Bla bla bla bla bla Bla bla bla bla bla Bla bla bla bla bla. Bla bla bla bla bla Bla bla bla bla bla Bla bla bla bla bla Bla bla bla bla bla Bla bla bla bla bla Bla bla bla bla bla Bla bla bla bla bla Bla bla bla bla bla Bla bla bla bla bla Bla bla bla bla bla Bla bla bla bla bla</p> </div> <p><br clear="all"> <!-- without this little <br /> NS6 and IE5PC do not stretch the toptext div down to encopass the content DIVs --> </div> </body> </html> |