CSS - Keeping Your Menu In A Static Position
I am not an expert on developing websites, but I've been able to get our site up and running without much challenge. I used a menu I found on www.dynamicdrive.com that allowed you to have our menu in a horizontal or verticle layout.
We don't use frames in our site but we wanted a frames-type look. So we use the menu in the vertical layout. What I'd like to do is find a way to keep the menu on the screen as people scroll down. I've seen other websites do this and have looked at a couple that were recommended from a previous post, but I can't figure out how to make it work propertly. Our website is www.indyartistgroup.com. If someone could take a look at the site and suggest some ideas on how to make the menu on the left hand side stay on screen no matter how low you scroll I would appreciate it. I'm out of options at this point. Thanks for the help. John Similar TutorialsI'm trying to have the contact information for a site to always appear in a right div next to the main content div. I would like it to always appear in the top right of the div, no matter how much the user scrolls down. This way, the information is always visible. I tried experimenting with background images in certain divs, but Firefox (but not IE) was having trouble displaying it the way I wanted. I've seen it in action before, so I'll post a URL if i can find where. I'm really tired, so this may be a dumb question. I'm having problems keeping thumbnails fixed in their position. I want them to have a 1px yellow border when I hover over them. I can get the border but when I hover over them the other images move slightly. I have the thumbnails set up inside a <ul>. Here's the pertinent CSS: Code: #thumbcontainer { margin-left: auto; margin-right: auto; margin-top: 10px; margin-bottom: 0px; padding: 10px 10px 0px 0px; width: 840px; background-color: #000000; } a img { border: none; margin: 4px 4px 10px 4px; } a img: link { border: 1px solid #000000; } a img: visited { border: 1px solid #000000; } a img:hover { border: 1px solid #e5cb43; } a img: active { border: 1px solid #000000; } ul.content { list-style-position: outside; padding: 0px; margin: 0px; border: none; background-color: #000000; width: 850px; text-align: center; } li.content { margin: 0px; padding: 0px; list-style-type:none; } What are my options? Thanks in advance! I want to make it so that when you go to type something into the textbox(lastname or firstname) the menu stays open. right now if you try and type something into the textbox the menu closes but you still keep right on writing and then go back into the menu and click the submit button. I also want it so that you can press the <enter> key on your keyboard and it will submit the search query that you are working on. if there is a better way of doing this all please let me know this is menu.php PHP Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>BHI and Roth's Website menu</title> <?php <link rel="stylesheet" type="text/css" href="menu_css.css" /> </head> <BODY STYLE="background-color:transparent"> <ul class="pureCssMenu pureCssMenum"> <li class="pureCssMenui"><a class="pureCssMenui" href="home.php" target="showframe">Home</a></li> <li class="pureCssMenui"><a class="pureCssMenui" href="#"><span>Fill-in a form</span><![if gt IE 6]></a><![endif]><!--[if lte IE 6]><table><tr><td><![endif]--> <ul class="pureCssMenum"> <li class="pureCssMenui"><a class="pureCssMenui" href="form_bhi_hoac.php" target="showframe">102HOAC</a></li> <li class="pureCssMenui"><a class="pureCssMenui" href="form_for_adding_email_addresses.php" target="showframe">Email database</a></li> <li class="pureCssMenui"><a class="pureCssMenui" href="form_support_application.php" target="showframe">Support Application</a></li> </ul> <!--[if lte IE 6]></td></tr></table></a><![endif]--></li> <li class="pureCssMenui"><a class="pureCssMenui" href="#"><span>View the form data</span><![if gt IE 6]></a><![endif]><!--[if lte IE 6]><table><tr><td><![endif]--> <ul class="pureCssMenum"> <li class="pureCssMenui"><a class="pureCssMenui" href="view_102hoac.php" target="showframe">102HOAC</a></li> <li class="pureCssMenui"><a class="pureCssMenui" href="#"><span>Search Addressbook by:</span><![if gt IE 6]></a><![endif]><!--[if lte IE 6]><table><tr><td><![endif]--> <ul class="pureCssMenum"> <li class="pureCssMenui"><a class="pureCssMenui" href="#"><span>Last Name:</span><![if gt IE 6]></a><![endif]><!--[if lte IE 6]><table><tr><td><![endif]--> <ul class="pureCssMenum"> <li class="pureCssMenui"><form class="pureCssMenui" action="lastname_search.php" method="post" target="showframe"><input type="text" name="lastname" size="30" /><input type="submit" align="right" value="Search" /></form></li> </ul> <!--[if lte IE 6]></td></tr></table></a><![endif]--></li> <li class="pureCssMenui"><a class="pureCssMenui" href="#"><span>First Name:</span><![if gt IE 6]></a><![endif]><!--[if lte IE 6]><table><tr><td><![endif]--> <ul class="pureCssMenum"> <li class="pureCssMenui"><form class="pureCssMenui" action="firstname_search.php" method="post" target="showframe"><input type="text" name="firstname" size="30" /><input type="submit" align="right" value="Search" /></form></li> </ul> <!--[if lte IE 6]></td></tr></table></a><![endif]--></li> </ul> <li class="pureCssMenui"><a class="pureCssMenui" href="sa.php" target="showframe">Support Application</a></li> </ul> <!--[if lte IE 6]></td></tr></table></a><![endif]--></li> <li class="pureCssMenui"><a class="pureCssMenui" href="#"><span>Resources</span><![if gt IE 6]></a><![endif]><!--[if lte IE 6]><table><tr><td><![endif]--> <ul class="pureCssMenui"> <li class="pureCssMenui"><a class="pureCssMenui" href="#"><span>View BHI Brochure -></span><![if gt IE 6]></a><![endif]><!--[if lte IE 6]><table><tr><td><![endif]--> <ul class="pureCssMenum"> <li class="pureCssMenui"><a class="pureCssMenui" href="bhi_brochure_feb_08.pdf" target="_blank">in .pdf format</a></li> <li class="pureCssMenui"><a class="pureCssMenui" href="bhi_brochure_feb_08.swf" target="_blank">in .swf format</a></li> </ul> </ul> <!--[if lte IE 6]></td></tr></table></a><![endif]--></li> <li class="pureCssMenui"><a class="pureCssMenui" href="gallery.html" target="showframe">Photo Gallery</a></li> <li class="pureCssMenui"><a class="pureCssMenui" href="edit.php" target="showframe">Edit account information</a></li> <li class="pureCssMenui"><a class="pureCssMenui" href="logout.php" target="_top">Logout</a></li> </ul> </body> </html> <?php } } } else //if the cookie does not exist, they are taken to the login screen { header("Location: login.php"); } ?> </html> And this is menu_css.css Code: #pcm{display:none;} ul.pureCssMenu ul{display:none} ul.pureCssMenu li:hover>ul{display:block} ul.pureCssMenu ul{position: absolute;left:0px;top:100%;} ul.pureCssMenu ul ul{position: absolute;left:100%;top:0px;} ul.pureCssMenu,ul.pureCssMenu ul { margin:0px; list-style:none; padding:0px 2px 2px 0px; background-color:#990033; background-repeat:repeat; border-color:#FFEE00; border-width:1px; border-style:solid; } ul.pureCssMenu table {border-collapse:collapse}ul.pureCssMenu { display:block; zoom:1; float: left; } ul.pureCssMenu ul{ width:210px;/*width:138.6px;*/ } ul.pureCssMenu li{ display:block; margin:2px 0px 0px 2px; font-size:0px; } ul.pureCssMenu a:active, ul.pureCssMenu a:focus { outline-style:none; } ul.pureCssMenu a, ul.pureCssMenu li.dis a:hover, ul.pureCssMenu li.sep a:hover { display:block; vertical-align:middle; background-color:#990033; border-width:0px; border-color:#990033; border-style:solid; text-align:center; text-decoration:none; padding:4px; _padding-left:4; font:normal 11.5px Verdana; color: #FFEE00; text-decoration:none; cursor:default; } ul.pureCssMenu span{ overflow:hidden; } ul.pureCssMenu li { float:left; } ul.pureCssMenu ul li { float:none; } ul.pureCssMenu ul a { text-align:left; white-space:nowrap; } ul.pureCssMenu li.sep{ text-align:center; padding:0px; line-height:0; height:100%; } ul.pureCssMenu li.sep span{ float:none; padding-right:0; width:5; height:16; display:inline-block; background-color:#BB99BB; background-image:none; } ul.pureCssMenu ul li.sep span{ width:80%; height:3; } ul.pureCssMenu li:hover{ position:relative; } ul.pureCssMenu li:hover>a{ background-color:#FFEE00; border-color:#0099cc; border-style:solid; font:normal 11.5px Verdana; color: #990033; text-decoration:none; } ul.pureCssMenu li a:hover{ position:relative; background-color:#FFEE00; border-color:#990033; border-style:solid; font:normal 11.5px Verdana; color: #990033; text-decoration:none; } ul.pureCssMenu li.dis a { color: #AAAAAA !important; } Hi there, I have an HTML/CSS design I'm working on, that can be accessed he http://www.design-portal.co.uk/demo/ The CSS can be found he http://www.design-portal.co.uk/demo/style.css Basically what I would like is this: I want another static area that always appears at the bottom of the page underneath the main content text. As I've fixed the big box thing's height (it's going to appear the same height on every page) I want the user to be able to scroll to the next page if the text is too long to fit on the one page. I've created a screenshot as an example: http://www.design-portal.co.uk/demo/images/demo.jpg As you can see, the text at the bottom allows the user to scroll forwards and backwards. I can do this, but it never appears at the bottom; always just underneath the text above it depending on how much text is in the place. How can I just get the damn thing to stay at the bottom regardless of how much content is above it? Cheers in advance, Dave My site is RegionalCreations.com if you want to see the issue for yourself. I actually haven't encountered this issue before with the countless sites I've made. I used the basic layout of an already made wordpress theme and redesigned it for my site, I didn't change the menu position however, so I think the issue is with the original theme. Here is an image showing the problem: Well apparently I can't post an image so go to my site and then add /images/IE-CSS-bug.jpg on to see it, thanks. As you can see my image across the top is off center in IE even though it looks fine in Firefox. My menu is also spaced down in IE when it shouldn't be. Here are the locations of my stylesheets, the second 1 loads after the main 1 if you view the page in IE. (I can't post the url so go to my site and add the rest of the url on.) Stylesheet: /main/wp-content/themes/cleanmachine/style.css IE additional style: /main/wp-content/themes/cleanmachine/ie-win.css If anyone can look at my stylesheets and tell me the problem that would be great. Thanks. 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! Hi everyone Now i hope you all wont get mad at me for this very nooby question i'm about to ask, but i'm pretty new to CSS at the moment, so im not sure what to do... Two questions actually, which i will explain. On my blog at the moment, ive put in a CSS dropdown navigation menu...the problem is that it automatically stays up the top of the page, i want to be able to position it down the bottom of the header... you can have a look at the blog here, which would help if anyone has any ideas...I want to position it just above the thin red line you can see... http://www.rivercitylife.org.au/testing/ another pain i'm having is that the menu is JUST overflowing the boundries of the page width...you can see there is a thin black line on the right hand side up at the header of the page... Sorry if i'm asking lots of questions to start with... Thanks to anyone who has any ideas and can help -Crawf Edit: Please let me know if you need any of the code or you want me to post the stylesheet for the menu.. Hi guys! I have good HTML knowledge, and I am learning CSS for the first time, no matter how much I read about position relative, absolute, fixed blah blah blah floats, clear, whitespace I am really struggling to get my head around it. I can position my header and side menu and main content easily as they sit side by side, The problem is I have a list with 4 bullet points, I want that to run horizontally which again I can do... but I want it to run horizontally over the main content part only and have 200px of "white space" to the side No matter what I try it all starts to mess up and wraps around the other parts. Idealy I'd like this 4 bullet point list to be a drop down horizontal menu, but if I can at least get it in the right place for now then that would be a start! Hope this makes sense, I also made a mockup in mspaint of what I mean but can't link it I also can't link my webpage to show you what I got so far as the forum wont me allow to link as a new user Thanks in advance! 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? Hi, I need to adjust only the 1st link(for 1st menu item) of my main menu. I have used pat pat template and have managed to apply a background image for the first item. Here is the css: Code: #first-suckerfish-vertical{ background:url(../images/menutop.jpg) no-repeat; height:75px; margin-top:-2.5px !important; margin-top:-3px; position:relative; } Now to apply style on the main menu item, i use a.mainlevel. but i cant use the a.mainlevel..coz it will adjust all the links. I need to apply style only to the first link of my menu. I am wondering if there's a way in css to access a class from another class or id. I already have this style(#first-suckerfish-vertical) for the 1st menu item. is it possible now to access the a.mainlevel from it.. Thx Hi, I am new to css and have written a code for a list menu in my page and i have added an image for instead of selecting the default bullets in css (ie. square, circle etc. so now my problem comes it looks perfect in Firefox browser but in IE 6 & 7 the position of the bullet image changes . In firefox it shows the bullet besides the text written and it is centered and perfect as i need but in IE 6 and 7 the image of the bullet moves up and sticks to the text instead of maintaining some distance with the text. i am providing u the link of my page below: r-interactive.net/clients/reed%5Fcss/ Also i am mentioning the css code which i have used for the list menu below : Css : Code: ul#listmenu { margin: 0; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px; color: #959595; padding-top: 0; padding-right: 0; padding-bottom: 0; text-indent: 5px; list-style-type: none; list-style-image: url(../images/main_images/img_industry_bullet.gif); list-style-position: inside; } ul#listmenu li { list-style-image: url(../images/main_images/img_industry_bullet.gif); margin-top: 0; margin-right: 0; margin-left: 0; padding-top: 0.5em; padding-right: 0; padding-bottom: 0.5em; padding-left: 0; border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: #207EC9; clear: both; } Html : Code: <ul id="listmenu"> <li> Jewelry Industry</li> <li> Aluminium Industry</li> <li> Electronics Industry</li> <li> Pharmaceutical Industry</li> <li> Oil & Gas Industry</li> <li> Cosmetics Industry</li> </ul> Help is always appreciated. I have a vertical menu on the left-hand side of my website, everything appears correctly when the page is first loaded but when I click on a menu item the entire div appears to shift to the left (10px). If I refresh the page it also appears correctly, so it is only when I have clicked on a menu item. I do know that there are plenty of problems with IE, but the menu does appear and function correctly in both IE and Opera. I am only having the problem with Mozilla. I am thinking that it may be something to do with the link visited properties but am not sure what. I have validated the css via the W3C website but there were no errors reported. The css segment is as follows: #subnavcontainer { position: absolute; left: 10px; top: 0px; margin-top:0px; padding-top: 0px; height: 700px; width: 160px; background: url("../images/bg_vert.gif") no-repeat; } #subnavcontainer ul { list-style-type: none; color: #000; margin-top: 0px; margin-left: 0px; padding-left: 0px; padding-top: 0px; font-family: Arial, Helvetica, sans-serif; display: block; width: 200px; background-color: #D7D7D7; } #subnavcontainer li { padding-left: 0px; margin-top: 1px; } #subnavcontainer ul li { margin: 0 0 1px 0; padding-left: 0px; } #subnavcontainer ul a { display: block; padding: 0px 2px 2px 5px; width: 160px; color: #000; background-color: #F0EFEE; text-decoration: none; border-left: 4px solid #B09292; } #subnavcontainer ul a:hover { color: #000; background-color: #fff; text-decoration: none; border-left: 4px solid #FF0000; } The html segment is as follows: <div id="subnavcontainer"> <ul> <li> <a href="../content/company/se_company_overview.htm" target="mainFrame">Overview</a> </li> <li> <a href="../content/company/se_company_location.htm" target="mainFrame">Location</a> </li> <li> <a href="../content/company/se_company_contact.htm" target="mainFrame">Contact</a> </li> </ul> </div> I have having issues with IE displaying my page wrong. The page is http://]http://tampabay-online.org/cetr/about.php (or any page within that site) and the css can be found at http://tampabay-online.org/cetr/cetr.css It displays fine in Firefox and Opera but IE makes the content class lower from the top than the #right navigation bar (they should both be 20 pixels form the top) Any help much appreciated. Code: .content { position:relative; width:320px; margin-left: 125px; margin-top: 20px; border:1px solid black; background-color:white; padding:10px; z-index:3; } #right { position:absolute; width:200px; top:20px; left:500px; border:1px solid black; background-color:white; padding:10px; z-index:1; } Hi, A simple question ... i'm sure i've done something like this before but can't remember how ... I centered a web page in the browser and used divs to hold the text and main content for the page - but when the page is viewed at different resolutions or left-side panels are opened (such as media player in IE) my div layers are not repositioning with the page ... I know this must be easy but it aint workin somehow ... thanks in advance ... I have a set of background images that work well in giving the impression that there is a solid page on screen. However, as you can see here , once I start introducing structure it falls apart and I'd really () like to know why. (The CSS validates OK and I've given temporary borders to the divs to help show where on the screen they should appear). Hi, I have a header, body and footer. I need the body to bee 550px tall regardless of the content. Then, the footer will be below this. Here's the CSS for the maincontant: Code: ..oneColFixCtr #mainContent { position:absolute; padding: 0, 10px, 0, 10px;/* remember that padding is the space inside the div box and margin is the space outside the div box */ overflow:auto; height:500px; width:768px; background-color:#FFFFFF; }{ How can I make the container 500 px tall no matter what the content is? As you can see he http://www.caillouette.com/SelvanSite3/BaselineFees.php The page changes height according to the content. I don't want this. I want the height to be static 500px. Thanks - I have a problem with my CSS. The intention was to get a static bar at the top of the page which stayed in place as the page was scrolled. That bit works fine. The problem is that the text in the main part of the page scrolls under the static bar. This means when you use any in page links ( to an anchor) the page scrolls so that the relevant part of the page is under the header div. Any ideas on how I can fix this ? The HTML is up at : http://www.benbun.co.uk/test/test.htm Any help would be appreciated. BBBS This problem has been sucking the life out of me for the last several hours. I'm developing a website with a CMS behind it. I have a page with a form on it that looks fine in FF, but seems to have an overflow problem in IE 6. But, what makes this even more strange is when I take the generated code and view it as a standalone HTML webpage with the same CSS behind it, it looks fine in IE! I'm reluctant to post the site of what will eventually be the live site because I don't want Google to find it, but like I said, I'm at the end of my rope! Here is the page of the site that does NOT work in IE (gets cut off right when the form is supposed to appear). http://westport.dreamhosters.com/modules/news/comment.php?id=4 And here is that page saved as a static HTML file with the same CSS file behind it: http://www.jimandkris.com/test/ In the static version, the form displays in its entirety in IE6. So, could someone confirm what I'm seeing? And even better, can anyone suggest anything? Hello, I have a problem with a footer on a website I'm building. I want it to my down as text fills the space between the top blue thing, and the bottom blue thing, but as you can see, the text skip past the bottom. I want the bottom to be pushed down by the text. Here's the site And here's the css Hope you can help me with this. |