CSS - Problems With 2 Css Menus On One Site
My web site has both a div/ul based drop down menu and expand/collapse menu on the site. I noticed that the drop down horizontal menu goes behind the images and links of the sidebar expand/collapse menu and snaps shut.
I had to change the li to another word to get the 2 styles to not confict over the <li> tags and it still works fine, but It seems to have an issue being in the same area as the <ul> (which I cannot remove. To see the problem, visit http://web3.avemarialaw.edu/index.cfm?event=ProspectiveStudent And mouse over the 'Prospective Student' menu in the top hortizonal bar. You'll see it go behind the title images. Also if you mouse down to about the 3rd drop down link, it snaps shut, but only if your mouse is to the left side. The right side of the dropped menus is fine. I would like the drop down menu to go over the side bar and take priority over the side bar. I am including the css and the javascript for both the hortizonal drop down menu and the side bar expand / collapse. Also, both of the styles for the menus are in the same .css file. Not sure if that makes a difference or not. Drop Down: Code: Javascript <script type="text/javascript"> //SuckerTree Horizontal Menu (Sept 14th, 06) //By Dynamic Drive: http://www.dynamicdrive.com/style/ var menuids=["treemenu1"] //Enter id(s) of SuckerTree UL menus, separated by commas function buildsubmenus_horizontal(){ for (var i=0; i<menuids.length; i++){ var ultags=document.getElementById(menuids[i]).getElementsByTagName("ul") for (var t=0; t<ultags.length; t++){ if (ultags[t].parentNode.parentNode.id==menuids[i]){ //if this is a first level submenu ultags[t].style.top=ultags[t].parentNode.offsetHeight+"px" //dynamically position first level submenus to be height of main menu item ultags[t].parentNode.getElementsByTagName("a")[0].className="mainfoldericon" } else{ //else if this is a sub level menu (ul) ultags[t].style.left=ultags[t-1].getElementsByTagName("a")[0].offsetWidth+"px" //position menu to the right of menu item that activated it ultags[t].parentNode.getElementsByTagName("a")[0].className="subfoldericon" } ultags[t].parentNode.onmouseover=function(){ this.getElementsByTagName("ul")[0].style.visibility="visible" } ultags[t].parentNode.onmouseout=function(){ this.getElementsByTagName("ul")[0].style.visibility="hidden" } } } } if (window.addEventListener) window.addEventListener("load", buildsubmenus_horizontal, false) else if (window.attachEvent) window.attachEvent("onload", buildsubmenus_horizontal) </script> CSS /* 3 Level drop down navigation for main */ .suckertreemenu ul{ margin: 0; padding: 0; list-style-type: none; } /*Top level list items* - Top Level Navigation*/ .suckertreemenu ul li { position: relative; display: inline; float: left; background-color: #FFCC33; /*overall menu background color!*/ } /*1st sub level menu*/ .suckertreemenu ul li ul { left: 0; width: 173px; position: absolute; top: 1em; /*no need to change, as true value set by script */ display: block; visibility: hidden; background-color: #DCD3B9; } /*Sub level menu list items (undo style from Top level List Items)*/ .suckertreemenu ul li ul li { display: list-item; float: none; background-color: #DCD3B9; } /*All subsequent sub menu levels offset after 1st level sub menu */ .suckertreemenu ul li ul li ul{ left: 159px; /* no need to change, as true value set by script */ top: 0; } /* Sub level menu links style */ .suckertreemenu ul li ul li a{ display: block; /*width: 160px; width of sub menu levels*/ color: #660000; font-family: Georgia, "Times New Roman", Times, serif; font-size:11px; font-weight:bolder; text-decoration: none; padding: 4px 1px 4px 7px; border-bottom: 1px solid #FFFFFF; /*Ouline color for drop down menus!*/ background-color: #DCD3B9; } .suckertreemenu ul li a:hover{ /*Changes the color of the menu as the mouse rolls over*/ background-color: #660000; color: #FFFF00; } /*Background image for top level menu list links */ .suckertreemenu .mainfoldericon{ background-color: #DCD3B9; } /*Background image for subsequent level menu list links */ .suckertreemenu .subfoldericon{ background-color: #DCD3B9; } * html p#iepara{ /*For a paragraph (if any) that immediately follows suckertree menu, add 1em top spacing between the two in IE*/ padding-top: 1px; } /* Holly Hack for IE \*/ * html .suckertreemenu ul li { float: left; height: 1%;} * html .suckertreemenu ul li a { height: 1%;} * html .suckertreemenu ul li ul li { float: left;} /*End 3 Level Main Navigation*/ Expand / Collapse: Code: Javascript <script language="javascript"> function toggle(id){ ul = "ul_" + id; img = "img_" + id; ulElement = document.getElementById(ul); imgElement = document.getElementById(img); if (ulElement){ if (ulElement.className == 'closed'){ ulElement.className = "open"; imgElement.src = "http://www.avemarialaw.edu/images/opened.gif"; }else{ ulElement.className = "closed"; imgElement.src = "http://www.avemarialaw.edu/images/closed.gif"; } } } </script> CSS /*Side Bar Nav*/ #menus { float: left; margin-left: -30px; padding-top:30px; width: 250px; position: relative; } .open { display: block; } .closed { display: none; } liv { /*Fix for confict between top level nav's <li>'s and sidebars*/ list-style-type: none; padding-top: .2em; padding-bottom: .2em; } liv img { vertical-align: middle; } /*End Side Bar Nav*/ Similar TutorialsI have been developing some dropdown menus loosely based on Patrick Griffiths "Suckerfish" example (see http://www.alistapart.com/articles/dropdowns/) and I have a prototype mostly working. The code is simple and is included in full below. However I see two problems with this that I can't sort out. First, in IE (6.0.2800) the dropdown is offset significantly from the left edge of the upper menu cell. In Mozilla (1.7.5) it's fine. I can't figure out why -- any ideas? I want it right underneath, not offset. Also, in Mozilla the dropdowns have a 1-pixel space at the right edge between the background and the border. Also a mystery ... Thanks for any comments / thoughts. Tom ======================================================== Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <head> <title>Test</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <style type="text/css"> body { font-family: arial, helvetica, serif; background: white url(images/ddbg3.gif) no-repeat 6000px 6000px; margin-left: 1em; } .mainlist { list-style: none; padding: 0; margin: 0; } .mainitem { float: left; position: relative; width: 120px; text-align: center; cursor: hand; padding: 0; border-top: 1px solid green; border-left: 1px solid green; border-bottom: 1px solid green; } .mainitem a { font-weight: bold; color: green; text-decoration: none; } .mainitemlast { border-right: 1px solid green; } .mainlist li:hover ul { display: block; left: 0; } li.over ul { display: block; left: 0; } .sublist { display: none; position: absolute; float: left; top: auto; font-weight: normal; background-color: #CCCCFF; width: 150px; padding: 0; } .subitem { display: block; float: left; position: relative; left: 0; width: 100%; border-top: 1px solid blue; border-left: 1px solid blue; border-right: 1px solid blue; } .subitemlast { border-bottom: 1px solid blue; } .subitem a { display: block; font-weight: normal; color: #060; padding: 5px; } .subitem a:hover { background-color: #EEEEFF; } </style> <script type="text/javascript"><!--//--><![CDATA[//><!-- startList = function() { if (document.all&&document.getElementById) { navRoot = document.getElementById("nav"); for (i=0; i<navRoot.childNodes.length; i++) { node = navRoot.childNodes[i]; if (node.nodeName=="LI") { node.onmouseover=function() { this.className+=" over"; } node.onmouseout=function() { this.className=this.className.replace(" over", ""); } } } } } window.onload=startList; //--><!]]></script> </head> <body> <div id="content"> <br> <ul class="mainlist" id="nav"> <li class="mainitem"> <div><a href="">Option 1</a></div> <ul class="sublist"> <li class="subitem"><a href="">Subitem 1</a></li> <li class="subitem"><a href="">Subitem 2</a></li> <li class="subitem"><a href="">Subitem 3 is longer</a></li> <li class="subitem subitemlast"><a href="">Subitem 4</a></li> </ul> </li> <li class="mainitem"> <div><a href="">Option 2</a></div> <ul class="sublist"> <li class="subitem"><a href="">Subitem 1</a></li> <li class="subitem"><a href="">Subitem 2</a></li> <li class="subitem"><a href="">Subitem 3 is longer</a></li> <li class="subitem subitemlast"><a href="">Subitem 4</a></li> </ul> </li> <li class="mainitem mainitemlast"> <div><a href="">Option 3</a></div> <ul class="sublist"> <li class="subitem"><a href="">Subitem 1</a></li> <li class="subitem"><a href="">Subitem 2</a></li> <li class="subitem"><a href="">Subitem 3 is longer</a></li> <li class="subitem subitemlast"><a href="">Subitem 4</a></li> </ul> </li> </ul> </div> </body> </html> Hi there I have a small problem with my web site on IE, and Im sure it something to do with the css, any help will be appreciated. SEE BELOW FOR DETAILS MY WEBSITE Code: @charset "ISO-8859-1"; body {margin:0;padding: 0px;font-family: Verdana, sans-serif;font-size: 0.75em;text-align:center;background-image:url(../images/FaiGurFrontPageBg3.jpg);} .wrapper { width:914px; margin-left:auto; margin-right:auto; background-color:#FFF;} .mainimg { background-image:url(../images/LOL4.jpg); width:914px; height:239px;} .aboutimg { background-image:url(../images/LOL6.jpg); width:914px; height:239px;} .mainimg { background-image:url(../images/LOL4.jpg); width:914px; height:239px;} .mainimg { background-image:url(../images/LOL4.jpg); width:914px; height:239px;} .imgfist { background-image:url(../images/FistsInfo.jpg); width:914px; height:174px;} .imgfoot { background-image:url(../images/FootInfo.jpg); width:914px; height:174px;} .logform {width:914px; height:28px; text-align:left; background-color:#930; color:#FFF;} .logform form {width:770px; float:left; margin:0 0 0 0; padding:0 0 0 0;} .form1 {width:526px; margin-left:auto; margin-right:auto; } .form1 table {margin:0 0 0 0;} .form1 form { margin:0 0 0 0;} .regpic {background-image: url(../images/Reg%20Pic.jpg); width:526px; height:122px;} .term {font-size:11px;} #wrapper2 { background-image:url(../images/TermsPage.jpg); width:914px; } .menubar { width:914px; padding-left:78px; background-color:#933; height:30px; padding:0; text-align:center; } .menubar ul { margin:0 auto 0 auto; padding:0 0 0 0; text-align:center; display:inline; } .menubar ul li { display:inline; height:30px; float:left; list-style-type:none; font-size:12px; margin:0; text-align:center; padding-top: 0; padding-right: 10px; padding-bottom: 0; padding-left: 10px; border-right:thin; border-right-color:#999; border-right-style:solid; } #wrapper2 { background-image:url(../images/TermsPage.jpg); width: 918px; height: 1548px;} .menubar ul li.first { border-left:thin; border-left-color:#999; border-left-style:solid; } .cent {margin-left:60px; margin-right:auto; text-align:center;} .menubar ul li a { text-decoration:none; padding:6px 0 0 0; margin:0 0 0 0; display:block; height:30px; color:#FFF;} .menubar ul li a:hover { text-decoration:none; padding:6px 0 0 0; margin:0 0 0 0; display:block; height:30px; color:#fff; background-color:#666} .flashdiv2 { overflow:hidden; margin:0 0 0 0 ; } .FlashVid { float:left; overflow:hidden; margin:0 0 0 0;} .leftbar { float:left; background-image:url(../images/RightbarNew.jpg); width:76px; height:630px; } .content { width:762px; height:630px; margin:0 0 0 0; padding:30px 0 0 0; float:left; background-color:#FFF; } .rightbar { float:left; background-image:url(../images/LeftbarNew.jpg); width:76px; height:630px; } .conttitle {font-family: Arial, Helvetica, sans-serif;font-weight: bold;font-size: 18px;text-align:center;} .contbody {font-family: "Comic Sans MS", cursive;font-size: 18px;text-align:left;} .con {height:750px;} .footer {background-color:#FFF;margin-left:auto; margin-right:auto; width:914px;} .clear { clear:both} I have been working with css for a while but web design is just a hobby for me so I am not that good when it comes to advanced css. The problem that I am having is that IE is not rendering me page right and I am not sure if it also supports png transparency be cause me background images are not coming out right. Everything for this page work just right in FF but IE is a whole other story. So if somebody could check out my site and suggest changes that I could make so that it does work right in both that would be awesome. My Site and here is me css file css Code: Original - css Code /* Basic style sheet */ html, body, ul, ol, li, p, h1, h2, h3, h4, h5, h6, form, fieldset { margin: 0px; padding: 0px; border: 0px; } body{ background-image: url(../images/thumbBG.gif); background-repeat: repeat; color: #999999; font-family: Arial, Helvetica, sans-serif; font-size: 100.01%; text-align: center; } #wrapper{ width: 800px; text-align: left; background-color: #1A1A1A; } #rightshadow{ width: 850px; margin-left: auto; margin-right: auto; background-image:url(../images/rightshadow.png); background-position: right top; background-repeat: repeat-y; /*background-attachment: inherit;*/ } #leftshadow{ padding-left: 25px; background-image: url(../images/leftshadow.png); background-position: left top; background-repeat: repeat-y; /*background-attachment: inherit;*/ } #banner{ height: 135px; background-position: center; background-repeat: no-repeat; background-image: url(../images/banner2.jpg); } #nav{ height: 10px; background-color: #000000; text-align: center; margin-bottom: 10px; } #nav ul{ padding: 0px; margin: 0px; background-color: #000000; } #nav ul li{ display: inline; padding: 0px; margin: 0px; } #nav ul li a{ font-size: 80%; color: #FFFFFF; background-color: #000000; text-decoration: none; padding: 0px 25px 0px 25px; text-align: center; width: 9em; } #nav ul li a:hover, #nav ul li a:focus{ background-color: #D0EB5A; color: #000000; } #usepic{ height: 110px; width: 104px; border: 1px solid #000000; background-color: #000000; margin-top: 5px; margin-bottom: 15px; margin-left: 5px; } #user{ float: left; width: 115px; background-color: #000000; text-align: center; margin-top: 10px; margin-left: 13px; } /* html div#user { width: 20px; top: 38px; left:20px; position:absolute; }*/ #content{ margin-top: 10px; margin-right: 23px; margin-bottom: 4px; float: right; width: 625px; } .containAll{ background: #000000; margin-bottom: 10px; } .container{ width: 100%; float: none; margin-bottom: 10px; } #content p{ font-size: 80%; margin: 20px; font-weight: bold; } #content h1{ font-size: 130%; color: #003366; padding: 0px; margin: 20px; } #content h2{ font-size: 110%; color: #D0EB6A; padding: 0px; margin: 20px; } hr{ visibility: hidden; } .leftimage{ float: left; margin: 0px 10px 20px 0px; border: 1px solid #000000; } .rightimage{ float: right; margin: 0px 0px 20px 15px; border: 1px solid #000000; width: 150px; } .container hr{ clear: both; visibility: hidden; } hr{ visibility: visible; } #footer{ border-top: 1px solid #000000; background-color: #C0DB5A; color: #000000; clear: both; } #footer p{ padding: 3px; font-size: 70%; } #navcontainer{ font-size: 12px; width: 100px; margin-left: 5px; margin-bottom: 5px; } #navcontainer ul{ margin-left: 0px; padding-left: 0px; list-style-type: none; font-family: Arial, Helvetica, sans-serif; } #navcontainer a{ display: block; padding: 1px; width: 100px; background-color: #333333; border-bottom: 1px solid #1A1A1A; } #navcontainer a:link, #navlist a:visited{ color: #EEE; text-decoration: none; } #navcontainer a:hover{ background-color: #D0EB5A; color: #000000; } /* clearing ----------------------------------------------- */ .clearfix:after { /*content: "."; */ display: block; height: 0; clear: both; visibility: hidden; } * html>body .clearfix { display: inline; width: 100%; } * html .clearfix { /* Hides from IE-mac \*/ height: 1%; /* End hide from IE-mac */ }
Hi, For some reason my website is not showing in IE8, just a blank white screen?. I've checked the source code, and above the doctype declaration, a comment is appearing Code: <!-- Include the header --> My website It is working fine in other browsers, but not IE8. I cannot see where this comment is comming from though?. the code for my header.php is : here Hi there, I am still new to css and have run into some problems that are frustrating me to no end! I have validated my html and css and still am not sure what to do with my problems. I am having two sets of problems: A) problems between IE and FF B) getting my nested list on the left side to work properly Site viewable he http://www.kohlrbaby.com/revisionbaby/about.html CSS viewable he http://www.kohlrbaby.com/revisionbaby/kohlrbaby.css A) There are two problems I can see: 1) IE: the photo is moved over a few pixels from the left forcing the other item out of line 2) FF: The white background has disappeared. B) For my nested list I have 2 issues: 1) I was trying to make the main list items have a custom bullet (arrow.gif) but I can't seem to get it to work. 2) As well, I can't figure out how to get the list to move to the left and the sub list to be less indented Thank you! Jill When viewing the test version of my site apparently it has issues with lower resolutions. I'm using 1280x1024 and I guess some people are having issues with it at 1024x768. Is there a way to fix my code so there are no resolution problems, or minimal ones at that? Thanks. Hey guys, I'm in need of some help here. Okay, so. My site looks the way I want so far on google chrome and safari (mac). And right now I'm at the stage of getting it to display like the two. If anyone who decides to help doesn't have access to certain browsers, I'll further explain, but I think it's easiest said to see for yourself. Right now I'm focusing on ie6, ie7, ff3. The markup in some areas is whacky, I know, but I decided to pick up where I left off on this project (which I first began building awhile ago) instead of starting completely over with a good template. http://thecheckoutplace.com/compute...eOneNetbook.php If anyone can offer a hand, it means a lot. Cheers guys. Hi there. I've become fond of the idea of non-javascript menus. I've been experimenting a little. So with help from various sources I managed to get a simple set working. I have this... Code: #menu ul li > ul { display: none; position: absolute; top: 18px; left: 0; width: 170px; } which correctly 'hides' the sub-menu. Then I have this Code: #menu ul li:hover > ul { display: block; } which should 'unhide' the sub-menu. Now, because I'd had success with the menu, I thought I should now look at validating my html and css. So far, I've just looked at the html part. My question is, why does it work with this code (which doesn't validate under Strict doctype)? Code: <div id="menu"> <ul> <li class="small"><a href="blah.php">About</a> <li>Details On... <ul> <li class="small"><a href="blah.php">Registering</a> </ul> </ul> </div> and not this (which does validate)? Code: <div id="menu"> <ul> <li class="small"><a href="blah.php">About</a></li> <li>Details On...</li> <li> <ul> <li class="small"><a href="blah.php">Registering</a></li> </ul> </li> </ul> </div> I'll listen to any thoughts on this, even the use (or not) of doctype strict. Thanks for listening! Stay JOLLY H Please help me. This is driving me crazy. I am getting a problem in IE and I can't seem to figure out how to fix it. Of course, it works just fine in Firefox, but not IE. In IE, go to to this page. On the horizontal drop-down menu, go to "Guides." Then scroll through the three drop-down options and back up. Notice how the 3rd level menu suddenly dissapears behind the 2nd level menu? Here's the portion of my CSS file controling the menu: Code: /********** LAYOUT - HEADER **********/ #header {background: #ffffff; margin-top: 10px; margin-bottom: 25px; padding: 0 0 8px;} img.headerimg {margin-left: 25px;} /** NAV - top horizontal nav **/ #nav, #nav ul {padding: 0; margin: 0; list-style: none} #nav {height:1.5em; font: 80% arial; margin-top: 1em; margin-left: 75px;} #nav li {position:relative; float: left; width: auto; display:block; margin: 0; padding:0} #nav a {display: block; padding: 3px 10px 2px; border-bottom: 1px solid rgb(98,61,15); border-top: 1px solid rgb(98,61,15);} /************* 2nd tier *************/ #nav li ul {width: 15em; position: absolute; left: -999em; background: #ffffff} #nav li:hover ul, #nav li.sfhover ul {left: 10px; z-index:55555} #nav li li {background:#9BCD9B; float:none; border: 1px solid rgb(98,61,15); border-top: none; padding-left: 0} #nav li li a, #nav li li a:link, #nav li li a:visited, #nav li li a:hover {color:#000; padding: 3px 10px; border-bottom: none; border-top: none;} #nav li li a:hover {color: #000; background: #FFDAB9;} #nav li.active {background: #FFDAB9;} #nav li.active a {color: #000000} /************* 3rd tier *************/ #nav li ul ul {width: 30em; font-size: 100%; margin-left: 7em; margin-top: -.7em} #nav li:hover ul ul, #nav li.sfhover ul ul {left: -999em;} #nav li li:hover ul, #nav li li.sfhover ul {left: auto;} #nav li li li {background: #f6f6f6; border-top: 1px solid #fff;} #nav li li li a, #nav li li li a:link, #nav li li li a:visited, #nav li li li a:hover {color: #006400} /************* 4th tier *************/ #nav li ul ul ul{width: 30em;} #nav li:hover ul ul ul, #nav li.sfhover ul ul ul {left: -999em;} #nav li li li:hover ul, #nav li li li.sfhover ul {left: auto;} #nav li li li li {background: #FFDAB9;} #nav li li li li a:hover {color: #000; background: #9BCD9B;} Please help me! Thanks! Manny Hi, I wanted to do a horizontal popout menu. I have the code and it works but I am trying to undertsand it better. It uses a csshover.htc file which i didn't download but the thing still works fine with a ie sniffer code in it. It doesn't use any javascript which I thought it needed. There seems a few ways to do expanding menus in css (with/without javascript)? Menus are more complicated than they look but I would some explanation on the above points before i continue. Hello does anyone have any links to good tabs tutorials I been looking at some other and most of the CSS code would not work well but I would just like some links thanks for ur time I am learning CSS and started to like it I was trying to make an image gallery so was just playing around with this link I got Please see this http://www.cssplay.co.uk/menus/tabmenu.html When I added five more images in this, the last images ceases to display How can I correct that I was testing this by adding this code 5 times <li> <a href="#nogo"> William Turner<br /> (1775-1851) <span> <img src="../img/turner.jpg" alt="painting" title="painting" /> This English painter was one of the greatest romantic interpreters of nature in the history of Western art and is still unrivaled in the virtuosity of his painting of light. </span> </a> </li> I was anticipating that a scrollbar would come automatically in the browser but that dint happen What should I do? I am very new to this whole css thing, but am trying to get all learned about it. I think I am doing badly so far. I am trying to make css drop-down menus, and have pulled code from all over the place, and modified it to look correct (so as to match my design comp). it is based on the suckerfish model <http://www.alistapart.com/articles/dropdowns/> and it works exactly as it should in safari, firefox (mac & pc). but doesn't work correctly at all in IE (mac or pc). I have implemented the "ie fix" with the javascript code several sites instructed me to use, and while it now sorta works (in the sense that the menus drop down), there are still problems. such as in IE on pc you can't roll down to the drop down menus, because they go away as soon as you roll off the top menu item. in IE on mac they are messed up in a whole other way. you can roll down to them, and they don't go away as soon as you're off the top nav option, but the hover is all jacked, and the menu is broken, sending the last nav button down to the next line! aaahhh! can anyone help me?! I'm sorry I'm so stupid and helpless, but... well. I am. any tips/etc would be mighty appreciated! -daniel I have this test site using CSS drop down menus, but when you scroll over, they disappear. Seems to be happening in IE9, Firefox and Chrome. Can't figure it out. Any help would be appreciated! Here is the script: Code: <head> <title>Untitled Document</title> <style type="text/css"> body {background-color: #FFFFFF; font-family: verdana, arial; font-size: 10pt; font-weight: bold; color: #0000ff;} .box1 { width: 1000px; height: 600px; position:relative; left: 150px; top: 0px; } .blue_box { width: 900px; position:absolute; top: 5px; left: 20px; height: 15px; } .box2 { width: 1050px; position:absolute; top: 40px; left: 20px; height: 15px; z-index: 2; } .main_image { position: relative; top: 3px; } .pic_box { width: 738px; /* 10px longer than actual jpg */ position:absolute; top: 75px; height: 167px; left: 20px; z-index; 1; } .text_box1 { width: 738px; position:absolute; top: 218px; height: 159px; left: 26px; border-color: #ff0000; } .education_box { width: 881px; position:absolute; top: 321px; height: 350px; left: 21px; } .top_news_box { width: 136px; position:absolute; top: 1px; height: 317px; margin-left: 5px; left: 715px; border-color: #ff0000; } /*Credits: Dynamic Drive CSS Library */ /* Top menu */ .menu ul{ padding: 3px 0; margin-left: 0; margin-top: 1px; margin-bottom: 0; font: bold 12px Verdana; list-style-type: none; text-align: center; /*set to left, center, or right to align the menu as desired*/ } .menu li{ display: inline; margin: 0; } .menu li a{ text-decoration: none; padding: 5px 7px; margin-right: 5px; border: 1px solid #778; color: white; background: #3282c2; border-radius: 8px; /*w3c border radius*/ box-shadow: 3px 3px 4px rgba(0,0,0,.5); /* w3c box shadow */ -moz-border-radius: 8px; /* mozilla border radius */ -moz-box-shadow: 3px 3px 4px rgba(0,0,0,.5); /* mozilla box shadow */ background: -moz-linear-gradient(center top, #a4ccec, #72a6d4 25%, #3282c2 45%, #357cbd 85%, #72a6d4); /* mozilla gradient background */ -webkit-border-radius: 8px; /* webkit border radius */ -webkit-box-shadow: 3px 3px 4px rgba(0,0,0,.5); /* webkit box shadow */ background: -webkit-gradient(linear, center top, center bottom, from(#a4ccec), color-stop(25%, #72a6d4), color-stop(45%, #3282c2), color-stop(85%, #357cbd), to(#72a6d4)); /* webkit gradient background */ } .menu li a { background: darkred; background: -moz-linear-gradient(center top, #f5795d, #e55e3f 25%, #d02700 45%, #e55e3f 85%, #f5795d); background: -webkit-gradient(linear, center top, center bottom, from(#f5795d), color-stop(25%, #e55e3f), color-stop(45%, #d02700), color-stop(85%, #e55e3f), to(#f5795d)); } .menu li a:hover{ color: #FFFFFFF; background:#0033CC; } /* Drop down menu buttons */ .blue ul { /* For all tags under <ul> (main and sub) */ padding: 3px 0; margin-left: 0; margin-top: 1px; margin-bottom: 0; font: bold 10pt Verdana; list-style-type: none; text-align: center; /*set to left, center, or right to align the menu as desired*/ } .blue li { /* Sets the properties associated with <li> */ display: inline; /* Sets li tags horizontal(main and sub) */ position: relative; margin: 0; } .blue li a { /* Sets the properties associated for all anchor tags */ text-decoration: none; padding: 5px 7px; margin-right: 15px; /* Sets margin to 15px, which spaces out each menu button by 15px */ border: 1px solid #778; color: white; background: #3282c2; border-radius: 8px; /*w3c border radius*/ box-shadow: 3px 3px 4px rgba(0,0,0,.5); /* w3c box shadow */ -moz-border-radius: 8px; /* mozilla border radius */ -moz-box-shadow: 3px 3px 4px rgba(0,0,0,.5); /* mozilla box shadow */ background: -moz-linear-gradient(center top, #a4ccec, #72a6d4 25%, #3282c2 45%, #357cbd 85%, #72a6d4); /* mozilla gradient background */ -webkit-border-radius: 8px; /* webkit border radius */ -webkit-box-shadow: 3px 3px 4px rgba(0,0,0,.5); /* webkit box shadow */ background: -webkit-gradient(linear, center top, center bottom, from(#a4ccec), color-stop(25%, #72a6d4), color-stop(45%, #3282c2), color-stop(85%, #357cbd), to(#72a6d4)); /* webkit gradient background */ } .blue li ul { /* Sets the properties for all li ul (sub menus). Rest is inherited */ position: absolute; /* All settings (e.g. left, top, etc.) will be relative to the top menu buttons (non sub menu buttons) */ left: 1px; display: none; /* Blocks all sub menu tags */ } .blue li:hover ul{ display: block; /* Shows all elements under each other (as opposed to next to each other) */ } .blue li:hover ul a { position: absolute; width: 150px; top: 5px; /* Amount of space the first sub menu starts from the parent button */ border-radius: 8px; text-decoration: none; background-color: #0000FF; padding: 5px; /* Pads area around text 5x in all 4 directions */ border: 1px solid #cccccc; border-bottom: 0; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 9pt; font-weight: bold; color: #FFFFFF; } </style> </head> <body> <div class="box1"> <div class="blue_box"> <div class="menu"> <ul> <li><a href="">Join MSSNY</a></li> <li><a href="">Pay Dues On Line</a></li> <li><a href="">Directory Questionaire</a></li> <li><a href="">MSSNYPAC</a></li> <li><a href="">Grassroots Action Center</a></li> <li><a href="">Member Login</a></li> </ul> </div><!-- Close menu --> </div><!-- Close box2 --> <div class="box2"> <div class="blue"> <ul> <li><a href="#">Home</a></li> <li><a href="#">About MSSNY</a> <ul> <li><a href="#">Divisions</a></li> <li><a href="#">Governance</a></li> <li><a href="#">Committees</a></li> <li><a href="#">Member Sections</a></li> <li><a href="#">House of Delegates</a></li> <li><a href="#">Position Statements</a></li> <li><a href="#">By Laws</a></li> <li><a href="#">Contact Us</a></li> </ul> </li> <li><a href="#">Membership</a> <ul> <li><a href="#">Applications</a></li> <li><a href="#">Pay Dues Online</a></li> <li><a href="#">AAPI Physicians</a></li> <li><a href="#">NYS Medical Directory</a></li> </ul> </li> <li><a href="#">Medical Community</a> <ul> <li><a href="#">County Societies</a></li> <li><a href="#">Speciality Societies</a></li> <li><a href="#">State Societies</a></li> <li><a href="#">Ethnic Medical Associations</a></li> <li><a href="#">American Medical Association</a></li> <li><a href="#">NYS Department of Health</a></li> <li><a href="#">Additional Medical Links</a></li> </ul> </li> <li><a href="#">Public Health</a> <ul> <li><a href="#"></a></li> <li><a href="#"></a></li> <li><a href="#"></a></li> <li><a href="#"></a></li> </ul> </li> <li><a href="#">Physician Advocacy</a> <ul> <li><a href="#"></a></li> <li><a href="#"></a></li> <li><a href="#"></a></li> <li><a href="#"></a></li> </ul> <li><a href="#">Practice Resources</a> <ul> <li><a href="#">WCB Guidelines and Fee Schedule</a></li> <li><a href="#">EHR Implementation Services</a></li> <li><a href="#">CME Physicial Education</a></li> <li><a href="#">MSSNY Online Library</a></li> </ul> </li> </ul> </div> <!-- Close blue --> </div> <!-- Close blue_box --> <div class="pic_box"><img src="050211a_Original.jpg" class="main_image" width="691" height="136" border="0" /> <!-- Close top_news_Box --> <div class="top_news_box"> <p><img src="Facebook-Twitter-Linkedin.JPG" border="0" /></p> <p>Visit the MSSNY Blog Forum. .</p> <p>News of New York<br /> Rate Card and Classifieds </p> <p> MSSNY eNews 6/17/11 </p> <p>MSSNY Legal Resources </p> <p> *** Members Section *** <br /> Members: Click Here</p> <p> Non Members: <br /> Browse Our Benefits Join US </p> <p> <br /> </p> </div> </div> <!-- Close pic_box --> <div class="text_box1">To All New York Physicians: No Tort Reform HOD Ref. Comm. Documents Health Care Reform <br /> <br /> WCB Guidelines and Fee Schedule 6-Credit CME Course on New Workers Compensation <br /> Treatment Guidelines <br /> <br /> Influenza Surveillance: How to become an ILINET Provider for 2010-11 flu season <br /> </div> <div class="education_box"><img src="MED101014-Infection-Course-Image_1.jpg" width="263" height="219" border="0" /> <img src="MED100513-Course-Graphic.jpg" border="0" /></div> <!-- Close pic_box --> </div> </body> </html> Dear Forum, I am designing a website using HTML and Java for the drop down menus. Although for one page this seemed ok at the begining, now I want to add links to other catagories where I only want to change the main body of the page. Up to now I have had to insert the Java script into every page I want to link to. The problem is A) The pages blink and the menu is lost while the graphics are being loaded, B) If I need to change the menus in the future I have to change all pages. Is there a way I can use CSS to keep the consistency of the Top and sides of the page and only change the body for other pages. I can do this with frames but I prefer not to use them. The test page can be seen at http://test.kipseli.com Thanks Rob In today's Website Development world, which kind of Drop Down menus do the pro's prefer to use, pure CSS without Javascript or CSS with Javascript? And also, can pure CSS Drop Down menus be used in Dynamic Websites? Thank you. Hi All, I seem to have made a mistake in installing a CSS drop-down menu b/c despite my best efforts, I cannot seem to make it work in Internet Explorer. I am using the Suckerfish method found http://www.alistapart.com/articles/dropdowns My CSS file is here And a sample page can be found here Does anyone see a mistake I made? All other browsers work beautifully, so the problem must lie in the Internet Explorer hack. Hi there, I'm trying to integrate some SEO friendly dropdown menus into an existing website design. The trouble I'm experiencing so far is that the body of the design is aligned centre, and most of the examples I've seen thus far use absolute positioning of <div> elements (i.e. the design is left-aligned, so the designer knows to position the dropdown div X pixels). Is there a good reference I can use for positioning my divs properly? Thanks Hello, I'm trying to replace one CSS nav menu with another, is there anyone who is familiar enough to assist me? Thank you for your time and assistance. I am working on building my first website in 2 years. I am very interested in developing a good site interface with standard code that may be easily edited later. Specifically, I am interested in creating dynamic navigation menus that will be supported by as many browsers as possible. I have seen dynamic menus created with javascript, but I know I don't want to do that since some browsers do not support it/or do not have it enabled by default. Can you comment on whether or not CSS would be a good solution to get around this problem? I have never used CSS to create menus in the past, but it seems very useful for standardizing a site interface. I am also open to other suggestions, what would you do to accomplish this task? |