CSS - Editing Top Navigation In Css And Html
Greetings,
Several years ago, I use to make many, many websites for a hobby. However, with work and other responsibilities (and moving to China), I have had my hands full. However, I am in the process of trying to open my own Education Center in China, and would like to develop a site. Much has changed, though, and I have also forgotten much. I never used CSS in my old sites, but now it seems almost all templates have CSS. I downloaded a free template, and am in the process of editing it. I can stumble through much of it and figure it out, but I am having trouble with the top and bottom menus of my site. I have two flags on the top menu that I need to change the alignment on. I want them to be closer together, and vertically aligned in the middle. I have fiddled with the code, but only make it worse. Also, I want the top and bottom menu to be perfectly centered, but the only way I can adjust them are be tweaking some numbers, and cannot do it with the center code. Some help would be MUCH appreciated for this old dog. My site is concord(dash)sihai(dot)com. As you can see, the flag position is correct, but the spacing between them is not. And they have inherited the rollover, background effect, which is not what I want. Thanks, Shawn Similar TutorialsHi All, I am building a site that has the following structure for the navigation; Code: <div id="navigation"> <ul id="navlist"> <li class="home"><a href="../index.asp" title="home"><span>home</span></a></li> <li class="aboutus"><a href="../aboutus.htm" title="aboout us"><span>about us</span></a></li> <li class="ourservices"><a href="../ourservices.htm" title="our services"><span>our services</span></a> <ul> <li class="internationalmail"><a href="ourservices_internationalmail.htm" title="international mail"><span>international mail</span></a></li> <li class="worldwidecourier"><a href="ourservices_worldwidecourier.htm" title="worldwide courier"><span>worldwide courier</span></a></li> <li class="worldwidefreight"><a href="ourservices_worldwidefreight.htm" title="worldwide freight"><span>worldwide freight</span></a></li> <li class="storage"><a href="ourservices_storage.htm" title="storage"><span>storage</span></a></li> <li class="publishingservices"><a href="ourservices_publishingservices.htm" title="publishing services"><span>publishing services</span></a></li> </ul> </li> <li class="requestquote"><a href="../requestquote.htm" title="request a quote"><span>request a quote</span></a></li> <li class="contactus"><a href="../contactus.htm" title="contact us"><span>contact us</span></a></li> </ul> </div> The main LI is horizontal, and the containing UL, LI is a vertical dropdown. The seperate CSS file does the image replacements on the <a> and hides the text within the <span>, usual stuff. The nav works great, with the graphic rollovers etc. The rollover, again, standard way of doing it, background: url(<FILE>) no-repeat top left; and the a:hover rollover is a background: bottom left;. Edit: Just noticed that I can't link to the full site that I have uploaded for preview. What I want to do, is when the user roll's over any of the items within the sub-navigation, it keeps the main Services navigation link rolled over also. The only way I could think of doing this, and relatively simply, would be to use JavaScript, but wanted to explore any other CSS ways of doing this. For example, is it possible to change a style of another class, from another? Your help would be much appreciated! ok im messing around with the css of some text within php... Code: "<p style=\"background: #e4ebeb; border: 1px solid #555555; padding: 6px;\"><span style=\"font: bold 10px Courier New;\"><div class=\"quote_header\">Quote by * :</div> <div class=\"quote_body\">*</div></span><br/>" ); a few questions... how would i make.. Quote by * : appear blue and have the * bold? i have tried adding <strong> and <b> at either side of the * and the php code just echos out <strong> or <b> I am trying to edit widths of my content tab div. Couldnt figure how. http://www.pearl.ru/isdunyasi/test2.asp I am using this tab content: http://www.dynamicdrive.com/dynamicindex17/tabcontent.htm I'm sure all of you have stumbled onto this at some point if you use Macromedia Dreamweaver. You're working on a CSS-driven layout and it looks perfect in multiple web browsers, but in the actual Dreamweaver design edit mode the page appears garbled and elements are out of place or you can't even see them. While it's not really a problem for you to update and work with the site, it would certainly be difficult for someone not familiar with it to change content and make updates. Does anyone know of a plug-in that would resolve this problem? Or perhaps does someone know what attributes or elements most often cause the problem in Dreamweaver? Hi, I have created a accordion menu using a spry widget built into Dreamweaver CS3. However I want to amend this so that the menu is collapsed until the user clicks on a category. Do I have to amend the CSS or the javascript to make it collapsed to begin with? Any help would be appericated. Thanks Gary Does anyone know how to manipulate images within spliced tables? I need to manipulate them with CSS so that that bottom half of the image is revealed only when it is clicked or hovered over? ("images/Home.gif", "images/services.gif", "images/Contact.gif", "images/Gallery.gif") <!-- Save for Web Slices (BannerEdit.psd) --> <table id="Table_01" width="974" height="220" border="0" cellpadding="0" cellspacing="0"> <tr> <td colspan="6"> <img src="images/SpliceBanner_01.jpg" width="974" height="137" alt=""></td> </tr> <tr> <td rowspan="3"> <img src="images/SpliceBanner_02.jpg" width="78" height="83" alt=""></td> <td rowspan="3"> <img src="images/Home.gif" width="208" height="83" alt=""></td> <td colspan="4"> <img src="images/SpliceBanner_04.jpg" width="688" height="1" alt=""></td> </tr> <tr> <td rowspan="2"> <img src="images/Services.gif" width="207" height="82" alt=""></td> <td colspan="3"> <img src="images/SpliceBanner_06.jpg" width="481" height="1" alt=""></td> </tr> <tr> <td> <img src="images/Contact.gif" width="205" height="81" alt=""></td> <td> <img src="images/Gallery.gif" width="198" height="81" alt=""></td> <td> <img src="images/SpliceBanner_09.jpg" width="78" height="81" alt=""></td> </tr> </table> <!-- End Save for Web Slices --> Hey all, I downloaded this DHTML script for a Dynamic-Fx Slide-In Menu from http://www.dynamicdrive.com and i'm facing some trouble. The menu suits my needs perfectly with only 1 problem. I want to position the menu in a fixed location on my website somewhere other than the edge of the screen, so i adjust the xy coordinates in the ssmItems.js file to do so...the problem is that the menu changes location depending on whether the window is maximized or not and on the resolution of the monitor. I want it to stay in 1 place ALWAYS! How? PLEASE HELP! there are two .js files associated with this scrip, ssmItems.js & ssm.js and a bit of html in the <head> section of the file into which the menu is placed. Please find all 3 below: HTML code in <head> section: <STYLE> <!-- A.ssmItems:link {color:black;text-decoration:none;} A.ssmItems:hover {color:black;text-decoration:none;} A.ssmItems:active {color:black;text-decoration:none;} A.ssmItems:visited {color:black;text-decoration:none;} //--> </STYLE> <SCRIPT SRC="ssm.js" language="JavaScript1.2"> </SCRIPT> <SCRIPT SRC="ssmItems.js" language="JavaScript1.2"></SCRIPT> <script type="text/javascript"> Code from ssmItems.js file <!-- /* Configure menu styles below NOTE: To edit the link colors, go to the STYLE tags and edit the ssm2Items colors */ YOffset=188; // no quotes!! XOffset=0; staticYOffset=30; // no quotes!! slideSpeed=20 // no quotes!! waitTime=100; // no quotes!! this sets the time the menu stays out for after the mouse goes off it. menuBGColor="feb300"; menuIsStatic="yes"; //this sets whether menu should stay static on the screen menuWidth=210; // Must be a multiple of 10! no quotes!! menuCols=2; hdrFontFamily="Arial"; hdrFontSize="2"; hdrFontColor="#feb300"; hdrBGColor="#000066"; hdrAlign="left"; hdrVAlign="center"; hdrHeight="15"; linkFontFamily="arial"; linkFontSize="2"; linkBGColor="white"; linkOverBGColor="#feb300"; linkTarget="_top"; linkAlign="Left"; barBGColor="#feb300"; barFontFamily="Arial"; barFontSize="2"; barFontColor="#000066"; barVAlign="center"; barWidth=20; // no quotes!! barText="RESOURCES MENU"; // <IMG> tag supported. Put exact html for an image to show. /////////////////////////// // ssmItems[...]=[name, link, target, colspan, endrow?] - leave 'link' and 'target' blank to make a header ssmItems[0]=["Apologetics Resources"] //create header ssmItems[1]=["Christ the Teacher Series", "http://www.lumenverum.org",""] ssmItems[2]=["Lord of History Series", "http://www.lumenverum.org",""] ssmItems[3]=["Other Booklets", "http://www.lumenverum.org", ""] ssmItems[4]=["Catholic Q&A Message Board", "http://www.lumenverum.org", ""] ssmItems[5]=["Ask us a question directly", "http://www.lumenverum.org", ""] ssmItems[6]=["LVA Catalogue"] //create header ssmItems[7]=["Books", "http://www.lumenverum.org", ""] ssmItems[8]=["Tapes / CD's", "http://www.lumenverum.org", ""] ssmItems[9]=["Other", "http://www.lumenverum.org", ""] ssmItems[10]=["Lumen Verum's..."] ssmItems[11]=["Consitution", "http://www.lumenverum.org", ""] ssmItems[12]=["Patron Saint", "http://www.lumenverum.org", ""] buildMenu(); //--> Code from ssm.js file NS6 = (document.getElementById&&!document.all) IE = (document.all) NS = (navigator.appName=="Netscape" && navigator.appVersion.charAt(0)=="4") tempBar='';barBuilt=0;ssmItems=new Array(); moving=setTimeout('null',1) function moveOut() { if ((NS6||NS)&&parseInt(ssm.left)<0 || IE && ssm.pixelLeft<0) { clearTimeout(moving);moving = setTimeout('moveOut()', slideSpeed);slideMenu(10)} else {clearTimeout(moving);moving=setTimeout('null',1)}}; function moveBack() {clearTimeout(moving);moving = setTimeout('moveBack1()', waitTime)} function moveBack1() { if ((NS6||NS) && parseInt(ssm.left)>(-menuWidth) || IE && ssm.pixelLeft>(-menuWidth)) { clearTimeout(moving);moving = setTimeout('moveBack1()', slideSpeed);slideMenu(-10)} else {clearTimeout(moving);moving=setTimeout('null',1)}} function slideMenu(num){ if (IE) {ssm.pixelLeft += num;} if (NS||NS6) {ssm.left = parseInt(ssm.left)+num;} if (NS) {bssm.clip.right+=num;bssm2.clip.right+=num;}} function makeStatic() { if (NS||NS6) {winY = window.pageYOffset;} if (IE) {winY = document.body.scrollTop;} if (NS6||IE||NS) { if (winY!=lastY&&winY>YOffset-staticYOffset) { smooth = .2 * (winY - lastY - YOffset + staticYOffset);} else if (YOffset-staticYOffset+lastY>YOffset-staticYOffset) { smooth = .2 * (winY - lastY - (YOffset-(YOffset-winY)));} else {smooth=0} if(smooth > 0) smooth = Math.ceil(smooth); else smooth = Math.floor(smooth); if (IE) bssm.pixelTop+=smooth; if (NS6||NS) bssm.top=parseInt(bssm.top)+smooth lastY = lastY+smooth; setTimeout('makeStatic()', 1)}} function buildBar() { if(barText.indexOf('<IMG')>-1) {tempBar=barText} else{for (b=0;b<barText.length;b++) {tempBar+=barText.charAt(b)+"<BR>"}} document.write('<td align="center" rowspan="100" width="'+barWidth+'" bgcolor="'+barBGColor+'" valign="'+barVAlign+'"><p align="center"><font face="'+barFontFamily+'" Size="'+barFontSize+'" COLOR="'+barFontColor+'"><B>'+tempBar+'</B></font></p></TD>')} function initSlide() { if (NS6){ssm=document.getElementById("thessm").style;bssm=document.getElementById("basessm").style; bssm.clip="rect(0 "+document.getElementById("thessm").offsetWidth+" "+document.getElementById("thessm").offsetHeight+" 0)";ssm.visibility="visible";} else if (IE) {ssm=document.all("thessm").style;bssm=document.all("basessm").style bssm.clip="rect(0 "+thessm.offsetWidth+" "+thessm.offsetHeight+" 0)";bssm.visibility = "visible";} else if (NS) {bssm=document.layers["basessm1"]; bssm2=bssm.document.layers["basessm2"];ssm=bssm2.document.layers["thessm"]; bssm2.clip.left=0;ssm.visibility = "show";} if (menuIsStatic=="yes") makeStatic();} function buildMenu() { if (IE||NS6) {document.write('<DIV ID="basessm" style="visibility:hidden;Position : Absolute ;Left : '+XOffset+' ;Top : '+YOffset+' ;Z-Index : 20;width:'+(menuWidth+barWidth+10)+'"><DIV ID="thessm" style="Position : Absolute ;Left : '+(-menuWidth)+' ;Top : 0 ;Z-Index : 20;" onmouseover="moveOut()" onmouseout="moveBack()">')} if (NS) {document.write('<LAYER name="basessm1" top="'+YOffset+'" LEFT='+XOffset+' visibility="show"><ILAYER name="basessm2"><LAYER visibility="hide" name="thessm" bgcolor="'+menuBGColor+'" left="'+(-menuWidth)+'" onmouseover="moveOut()" onmouseout="moveBack()">')} if (NS6){document.write('<table border="0" cellpadding="0" cellspacing="0" width="'+(menuWidth+barWidth+2)+'" bgcolor="'+menuBGColor+'"><TR><TD>')} document.write('<table border="0" cellpadding="0" cellspacing="1" width="'+(menuWidth+barWidth+2)+'" bgcolor="'+menuBGColor+'">'); for(i=0;i<ssmItems.length;i++) { if(!ssmItems[i][3]){ssmItems[i][3]=menuCols;ssmItems[i][5]=menuWidth-1} else if(ssmItems[i][3]!=menuCols)ssmItems[i][5]=Math.round(menuWidth*(ssmItems[i][3]/menuCols)-1); if(ssmItems[i-1]&&ssmItems[i-1][4]!="no"){document.write('<TR>')} if(!ssmItems[i][1]){ document.write('<td bgcolor="'+hdrBGColor+'" HEIGHT="'+hdrHeight+'" ALIGN="'+hdrAlign+'" VALIGN="'+hdrVAlign+'" WIDTH="'+ssmItems[i][5]+'" COLSPAN="'+ssmItems[i][3]+'"> <font face="'+hdrFontFamily+'" Size="'+hdrFontSize+'" COLOR="'+hdrFontColor+'"><b>'+ssmItems[i][0]+'</b></font></td>')} else {if(!ssmItems[i][2])ssmItems[i][2]=linkTarget; document.write('<TD BGCOLOR="'+linkBGColor+'" onmouseover="bgColor=\''+linkOverBGColor+'\'" onmouseout="bgColor=\''+linkBGColor+'\'" WIDTH="'+ssmItems[i][5]+'" COLSPAN="'+ssmItems[i][3]+'"><ILAYER><LAYER onmouseover="bgColor=\''+linkOverBGColor+'\'" onmouseout="bgColor=\''+linkBGColor+'\'" WIDTH="100%" ALIGN="'+linkAlign+'"><DIV ALIGN="'+linkAlign+'"><FONT face="'+linkFontFamily+'" Size="'+linkFontSize+'"> <A HREF="'+ssmItems[i][1]+'" target="'+ssmItems[i][2]+'" CLASS="ssmItems">'+ssmItems[i][0]+'</DIV></LAYER></ILAYER></TD>')} if(ssmItems[i][4]!="no"&&barBuilt==0){buildBar();barBuilt=1} if(ssmItems[i][4]!="no"){document.write('</TR>')}} document.write('</table>') if (NS6){document.write('</TD></TR></TABLE>')} if (IE||NS6) {document.write('</DIV></DIV>')} if (NS) {document.write('</LAYER></ILAYER></LAYER>')} theleft=-menuWidth;lastY=0;setTimeout('initSlide();', 1)} Hello. So I'm trying to make my html more semantic, so I'm trying to avoid divs and spans as much as possible. I'm trying to make an unordered list navigation, but it shows up really choppy in IE7. However, the moment I change it from <ul id="navigation"> to <div id="navigation">, it works perfectly. Just for semantics sake I'd like to see if I could keep the ul working. Here's the html code, it validates xhtml strict so you don't have to worry about that. Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <link href="css/global.css" rel="stylesheet" type="text/css" /> <title>Eagle Steel Buildings</title> </head> <body> <div id="wrapper"> <img id="banner" src="images/global/banner.jpg" alt="Eagle Steel Building"/> <ul id="navigation"> <li><a href="" class="selected">Home</a></li> <li><a href="">About Us</a></li> <li><a href="">Our Work</a></li> <li><a href="">Free Quote</a></li> <li><a href="">Contact Us</a></li> </ul> <h1>Steel Building Construction</h1> <h2>Lorem Ipsum</h2> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec ut ultrices tortor. In lectus turpis, porta in mollis et, feugiat ac ligula. Vivamus arcu mauris, accumsan id mollis eu, blandit sed odio. Donec id magna nec quam aliquam scelerisque quis in metus. Ut pharetra lorem nec neque condimentum at viverra leo euismod. Fusce vitae orci sed enim bibendum viverra sodales id elit. Fusce lectus purus, rutrum rhoncus consequat non, porta et nisi. Proin vitae est odio. Donec erat orci, mollis id viverra condimentum, feugiat nec est.</p> <h2>Lorem Ipsum</h2> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec ut ultrices tortor. In lectus turpis, porta in mollis et, feugiat ac ligula. Vivamus arcu mauris, accumsan id mollis eu, blandit sed odio. Donec id magna nec quam aliquam scelerisque quis in metus. Ut pharetra lorem nec neque condimentum at viverra leo euismod. Fusce vitae orci sed enim bibendum viverra sodales id elit. Fusce lectus purus, rutrum rhoncus consequat non, porta et nisi. Proin vitae est odio. Donec erat orci, mollis id viverra condimentum, feugiat nec est.</p> <h2>Lorem Ipsum</h2> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec ut ultrices tortor. In lectus turpis, porta in mollis et, feugiat ac ligula. Vivamus arcu mauris, accumsan id mollis eu, blandit sed odio. Donec id magna nec quam aliquam scelerisque quis in metus. Ut pharetra lorem nec neque condimentum at viverra leo euismod. Fusce vitae orci sed enim bibendum viverra sodales id elit. Fusce lectus purus, rutrum rhoncus consequat non, porta et nisi. Proin vitae est odio. Donec erat orci, mollis id viverra condimentum, feugiat nec est.</p> <form id="quoteform" action="quote_home.php" method="post"> <fieldset> <label for="name">Name</label><input type="text" name="name" id="name" /> <label for="date">Date</label><input type="text" name="date" id="date" /> <label for="phone">Phone</label><input type="text" name="phone" id="phone" /> <label for="email">Email</label><input type="text" name="email" id="email" /> <label for="location_zip_code">Location Zip Code</label><input type="text" name="location_zip_code" id="location_zip_code" /> <label for="width">Width</label><input type="text" name="width" id="width" /> <label for="length">Length</label><input type="text" name="length" id="length" /> <label for="sidewall_height">Sidewall Height</label><input type="text" name="sidewall_height" id="sidewall_height" /> </fieldset> </form> </div> </body> </html> And here's the CSS, also validated. Code: /* http://meyerweb.com/eric/tools/css/reset/ */ /* v1.0 | 20080212 */ html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, font, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, textarea dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td { margin: 0; padding: 0; border: 0; outline: 0; font-size: 100%; vertical-align: baseline; background: transparent; } body { line-height: 1; } blockquote, q { quotes: none; } blockquote:before, blockquote:after, q:before, q:after { content: ''; content: none; } /* remember to define focus styles! */ :focus { outline: 0; } /* remember to highlight inserts somehow! */ ins { text-decoration: none; } del { text-decoration: line-through; } /* tables still need 'cellspacing="0"' in the markup */ table { border-collapse: collapse; border-spacing: 0; } /* Begin Page Styles */ .btest{border:1px solid #FFFFFF;} body { background: #CCCCCC URL('../images/global/steelbg.jpg') top left; margin: 0px; padding: 0px;} #wrapper{ margin: 0px auto; width: 1010px; height: 1000px; background: URL('../images/global/wrappershadow.png') repeat-y;} #banner{ display: block; margin: 0px auto; width: 1000px; height: 250px; } #navigation{ display: block; margin: -2px auto 0px; width: 1000px; height: 38px; list-style-type:none; background: #000000 URL('../images/global/navbg.png') no-repeat;} #navigation a{ float: left; height: 39px; line-height: 2.3em; margin-top:3px; padding-left: 13px; padding-right: 13px; font-size: 1.0em; font-family: Verdana, serif; text-decoration: none; font-weight: bold; color: #CCCCCC; text-align: center;} #navigation a:hover, #navigation a.selected{ text-decoration: underline;} #navigation a.selected{ color: #ff0000;} I have not finished styling the rest of the page, I am only concerned with the navigation right now. I appreciate your time and effort! Hey guys I am currently having an issue with a CSS Navigation. I was wondering if anyone was available to help me out. http://schoolwide.sgajewski.com/menu/ I am currently having an issue with IE 7. It seems to be working in every other browser but the second level of the navigation is offset lower in IE7. The spacing starts off 1 pixel two low and progressively the gap gets wider. Code: ul.vertical, ul.vertical li { margin:0; padding:0; list-style-type:none; font-size:100%; } ul.vertical { position:absolute; z-index:1000; cursor:default; width:180px; left:1em; top:4.05em; } ul.vertical li { position:relative; text-align:left; cursor:pointer; cursor:hand; width:180px; margin:-1px 0 0 0; padding-bottom:0px!important; padding-bottom:1px; float:left; clear:both; top:0; left:0; } ul.vertical ul { z-index:1020; cursor:default; position:absolute; width:197px; margin:0 0 0 179px; top:-100em; left:-1px; padding:1px 0 0 0; height:0px; overflow:hidden; } ul.vertical ul li { width:197px; } ul.vertical ul ul { margin: 0 0 0 179px; } @media Screen, Projection { ul.vertical li:hover > ul { top:0; height:auto; overflow:visible; } } ul.vertical a, ul.vertical a:visited { display:block; cursor:pointer; cursor:hand; background:url(images/bg.jpg); padding:5px 7px; font:normal normal bold 0.7em tahoma, verdana, sans-serif; color:#008000; text-decoration:none; letter-spacing:1px; } ul.vertical a:hover, ul.vertical a:focus, ul.vertical a.rollover, ul.vertical a.rollover:visited { background:url(images/bg_over.jpg); color:#806020; } ul.vertical .outtop {background:url(images/bg_over_top.jpg);} ul.vertical .outbg {background:url(images/bg_over_mid.jpg);} ul.vertical .outbot {background:url(images/bg_over_bot.jpg);} ul.vertical ul a, ul.vertical ul a:hover, ul.vertical ul a:visited, ul.vertical ul a:active ul.vertical ul a:hover, ul.vertical ul a:focus, ul.vertical ul a.rollover, ul.vertical ul a.rollover:visited { background-image:none; } @media screen, projection { * html ul.vertical li { display:inline; f\loat:left; background:#ffffff; } } * html ul.vertical li { position:static; } * html ul.vertical a { position:relative; } ul[class^="vertical"] ul { display:none; } ul[class^="vertical"] ul { displa\y:block; } Any help on why this is offset in IE7 would be great. Thanks in advance. I have a nice little vertical navigation block that I would like to use in multiple pages within the same website. I would like to use the nav block without repeating the code, but I can't figure out how to do it. I have put the code in navigation.htm. What do I do next? Hello, I'm new to the forum and not very good with CSS yet. I'm slowly moving from tables to CSS. I set up a sample page to describe the problem I'm having but the forum won't allow me to post the URL here. I have a vertical CSS "LI" navigation section in the left hand sidebar of this web page and it works perfectly in every Mac browser I try it on (very latest Mac versions of Opera, Firefox, Safari, Chrome, Camino, Omniweb, etc.). There's a white, 1-pixel horizontal spacer/separator line between each link in the left sidebar which is supposed to be 220 pixels wide. It is 220 pixels wide on all the Mac browsers I try it on but for some reason, as soon as I try the web page in IE 7 or IE 8, the white horizontal 1-pixel divider line is shorter and ends up being only 195 pixels wide and throws the whole, nice and "even" look off. I don't understand where the 25 pixels are disappearing to in IE 7 and IE 8. Can anyone offer any insight as to what the fix may be or what I've done wrong? Below is the code I've used to create the navigation. Thanks so much. HTML Code: Code: <div id="navcontainer"> <ul id="navlist"> <li id="active"><a href="#" id="current">Home</A></li> <li><a href="#">On To Page 2</A></li> <li><a href="#">On To Page 3</A></li> <li><a href="#">On To Page 4</A></li> <li><a href="#">On To Page 5</A></li> </ul> </div> CSS Code: Code: #navlist { padding-left: 25px; margin-left: 0; width: 220px; } #navlist li { list-style: none; margin: 0; padding: 0.25em; border-top: 1px solid white; } #navlist li a { background: transparent url(../images/list_off.gif) left center no-repeat; padding-left: 15px; text-align: left; font-family: Arial, Helvetica, Verdana, sans-serif; font-size: 12px; font-weight: bold; color: #277eb1; text-decoration: none; line-height: 30px; } #navcontainer ul li a:hover { background: transparent url(../images/list_on.gif) left center no-repeat; color: #da251c; } #navcontainer ul li a#current { background: transparent url(../images/list_active.gif) left center no-repeat; color: #999999; } I'm pretty new to CSS, but I've managed to put together a website based from a psd, that validates and everything has gone well. My menu, however, is pretty shoddy. I have everything positioned the way I want it, but what I want to do is convert the lists inside from dropping down to being horizontal parallell to the nav bar itself. From: --- --- --- --- | | To: _ _ _ --- --- --- --- The site is here. Ignore the issues with the absolute positioning; its because of the ads at the top, and it doesn't affect the nav bar. I am desperatefor some help, it is ridiculous to figure out. Anyone who can help me, I would be crazy grateful. Thanks, Tom Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <style type="text/css"> /*BEGINNING OF CSS*/ body{ padding: 0px; background-color: #000000; font-family: Verdana; color: #FFFFFF; text-align: center; } div.container { margin: 0 auto; padding: 0px; width: 1024px; text-align: left; } div.left { float: left; } div.right { float: right; } div.logo { margin: 0 auto; background-position: top center; text-align: center; } div.header { text-align: center; padding-top: 0px; } div.navigation { background-color: #000000; background-image: url(http://i39.tinypic.com/igm16v.jpg); overflow: auto; } div.content { background-color: #000000; background-image: url(http://i39.tinypic.com/2ce2qus.jpg); overflow: auto; height: 525px; margin: 0 auto; } div.footer { background-color: transparent; background-image: url(http://i39.tinypic.com/2vjsbrp.jpg); overflow: auto; height: 290px; padding: 0px; margin: 0 auto; } p.head { text-align: left; font-size: 24px; } p.content { position: relative; font-size: 12px; } a.main { text-decoration: none; font-size: 18px; padding: 8px; color: #FFFFFF; background-color: transparent; } a.sub { font-size: 16px; line-height: 150%; text-align: left; text-decoration: none; color: #999999; background-color: transparent; } a.plain { text-decoration: none; font-size: 12px; color: #FFFFFF; background-color: transparent; } a.plainfoot { text-decoration: none; font-size: 12px; color: #959595; opacity: 90%; background-color: transparent; border-bottom: 1px solid #0d0f10; opacity: 100%; } #nav, #nav ul { margin: 0 auto; padding: 0px; list-style: none; } #nav a.main { display: block; margin-left: 5px; } #nav a.sub { display: block; width: 150px; margin-left: 5px; } #nav li { float: left; width: 5em; } #nav li ul { position: absolute; width: 1em; left: -999em; } #nav li:hover ul { left: auto; } #nav li ul { position: absolute; padding: 7px; width: 1em; left: -999em; } #nav li:hover ul { left: auto; } #nav li:hover ul, #nav li.sfhover ul { left: auto; font-family: lucida grand; } h1.footer { position: relative; font-size: 18px; color: #123712; margin-bottom: 0%; margin-left: 50px; } p.footer { font-size: 12px; color: #909090; margin-left: 50px; max-width: 200px; text-decoration: none; } h1.main { font-size: 28px; font-weight: 200; margin-left: 140px; padding: 0; text-shadow: #959595; } p.content { font-size: 12px; color: #FFFFFF; line-height: 130%; margin-left: 140px; max-width: 450px; text-decoration: none; } div.date { background-color: transparent; background-image: url(http://i39.tinypic.com/xnc3de.jpg); background-repeat: no-repeat; padding: 0px; margin-top: 17px; margin-left: 0px; } h1.main2 { font-size: 28px; font-weight: 200; margin-left: 140px; text-shadow: #959595; } p.content2 { font-size: 12px; line-height: 130%; margin-left: 140px; max-width: 450px; text-decoration: none; } div.date2 { background-color: transparent; background-image: url(http://i39.tinypic.com/xnc3de.jpg); background-repeat: no-repeat; padding: 0px; min-height: 100px; margin: 0px; } div.sidebar { background-color: transparent; background-image: url(http://i41.tinypic.com/2r76kpu.jpg); background-repeat: no-repeat; background-position: top right; padding: 0px; min-height: 200px; margin-top: 15px; margin-right: 15px; } div.datetext1 { position: absolute; background: transparent; font-family: verdana, sans-serif; font-size: 12px; font-weight: 200; color: #FFFFFF; left: auto; top: 382px; padding-top: 262px; padding-left: 44px; } div.dateid1 { position: absolute; background: transparent; font-family: verdana, sans-serif; font-size: 24px; font-weight: 300; color: #123712; left: auto; top: 382px; padding-top: 281px; padding-left: 47px; } div.datetext2 { position: absolute; background: transparent; font-family: verdana, sans-serif; font-size: 12px; font-weight: 200; color: #FFFFFF; left: auto; top: 382px; padding-top: 44px; padding-left: 44px; } div.dateid2 { position: absolute; background: transparent; font-family: verdana, sans-serif; font-size: 24px; font-weight: 300; color: #123712; left: auto; top: 382px; padding-top: 63px; padding-left: 47px; } div.sidebarhead { position: absolute; background: transparent; font-family: verdana, sans-serif; font-size: 18px; font-weight: 200; color: #123712; text-align: center; left: auto; top: 400px; padding-top: 15px; padding-left: 630px; } div.sidebartext { position: absolute; background: transparent; font-family: verdana, sans-serif; font-size: 10px; color: #FFFFFF; line-height: 130%; text-align: left; max-width: 168px; left: auto; top: 400px; padding-top: 50px; padding-left: 610px; } /*END OF CSS*/ </style> <script type="text/javascript"> sfHover = function() { var sfEls = document.getElementById("nav").getElementsByTagName("LI"); for (var i=0; i<sfEls.length; i++) { sfEls[i].onmouseover=function() { this.className+=" sfhover"; } sfEls[i].onmouseout=function() { this.className=this.className.replace(new RegExp(" sfhover\\b"), ""); } } } if (window.attachEvent) window.attachEvent("onload", sfHover); </script> <title>Obsidian Recording Front Page</title> </head> <body> <div class="container"> <div class="left"> <img src="http://i39.tinypic.com/14j6nsz.jpg" alt="left column"/> </div> <div class="right"> <img src="http://i40.tinypic.com/b4yir5.jpg" alt="right column"/> </div> <div class="logo"> <img src="http://i40.tinypic.com/2u77lua.jpg" alt="logo"/> </div> <div class="header"> <img src="http://i41.tinypic.com/1178qo6.jpg" alt="header"/> </div> <div class="navigation"> <ul id="nav"> <li><a class="main" href="http://www.obsidianrecording.com">Home</a></li> <li><a class="main" href="#">Music</a> <ul> <li><a class="sub" href="http://www.obsidianrecording.com/featured">Featured</a></li> <li><a class="sub" href="http://www.obsidianrecording.com/artists">Artists</a></li> <li><a class="sub" href="http://www.obsidianrecording.com/artists/thisisthefall">My Band</a></li> </ul> </li> <li><a class="main" href="http://www.obsidianrecording.com/design">Design</a></li> <li><a class="main" href="#">Store</a> <ul> <li><a class="sub" href="http://www.obsidianrecording.com/store/recording">Recording</a></li> <li><a class="sub" href="http://www.obsidianrecording.com/store/design">Design</a></li> <li><a class="sub" href="http://www.obsidianrecording.com/store/music">Music</a></li> </ul> </li> <li><a class="main" href="#">About</a> <ul> <li><a class="sub" href="http://www.obsidianrecording.com/about/rates">The Rates</a></li> <li><a class="sub" href="http://www.obsidianrecording.com/about/studio">The Studio</a></li> <li><a class="sub" href="http://www.obsidianrecording.com/about/tomhoneyman">Tom Honeyman</a></li> </ul> </li> </ul> </div> <div class="content" <div class="date"> <div class="sidebar" <h1 class="main">Cast into Shadows</h1> <p class="content">The first band ever to record at Obsidian Recording was Cast into Shadows. I'd like to shout out to Donnie, Evan, Josh, Brian, and J.T. for being the first group to come through here and for making a kickass record along the way. You can find more about them in the Artists section of the site.</p> </div> </div> <div class="date2"> <h1 class="main2">Website Launched!</h1> <p class="content2">After a looong time working on this site, I've finally finished just in time for summer! What you can expect is a lot of updates on what artists who record here are doing, free downloads, cool videos of their shows, special rates just for people who visit the site, and more. If you'd like to contact me, all my information and more is in the About section of the site. <br /><br /> Thanks for visiting, and I hope you enjoy!</p> </div> <div class="datetext1">Jun</div> <div class="dateid1">1</div> <div class="datetext2">Jun</div> <div class="dateid2">7</div> <div class="sidebarhead">New Website!</div> <div class="sidebartext">Welcome to the all-new Obsidian Recording site! I will regularly update with news, special rates, videos, featured free downloads, and more.</div> </div> <div class="footer"> <br /><br /><br /> <h1 class="footer">Recent Projects</h1> <p class="footer"><a class="plainfoot" href="www.obsidianrecording.com/artists/castintoshadows">Cast into Shadows</a><br /><br /><a class="plainfoot" href="http://www.obsidianrecording.com/artists/thisisthefall">This is the Fall</a></p> </div> </div> </body> </html> hi, i was wondering if anyone knw any links to ultra super dooper cool websites for css navigations. I want to learn how to do ace ones. I have already googleed about, I found the sliding doors on ALA an stuff but i need that little bit more cool tutorials prefrably!! I did find one cool one athttp://www.bulkherbstore.com/ thanks tom. How is this navigation done on the top of the page? I looked at the CSS and all the javascript. I can't see how the drop down is created? I tried to replicate it and copied the background images. I can get the menu to show and rollovers work. Just the drop down won't work. http://jmadvertising.com/ I have customised an open source wordpress template for my website and somewhere along the line seem to have broken the navigation as it appears in IE6,7,8. I use a mac so I didn't identify the problem straight away and I'm not sure how to fix it. I can work my way around CSS usually but I find navigation very difficult to grasp and so any help would be very much appreciated. blackmarlinfishingblog.com Problem: The child items of the navigation (drop downs) are appearing under the slideshow so you can't click on them. Thanks again in advance for any help you may be able to give! ::EDIT:: -- Problem solved! Thanks for informing me about those two validating websites... Turns out all I needed to do was apply "display:inline-block;" to my 'a' element... I knew it was a simple fix! I'm sure I will be here again for more problems needing solving Hi, I'm new to CSS and am trying to deign a navigation bar for a website. The problem that i face is trying to size the headings a little larger than the sub catagories. The code is as follows for the style sheet i have tried this: body{ font-family: Arial,sans-serif; color: #FFFFFF; line-height: 1.1; margin: 0px; padding: 0px; } a{ color: #FFFFFF; text-decoration: none; } a:link{ color: #FFFFFF; text-decoration: none; } a:visited{ color: #FFFFFF; text-decoration: none; } a:hover{ color: #FFFFFF; text-decoration: underline; } b{ color: #FFFFFF; text-decoration: none; } b:link{ color: #FFFFFF; text-decoration: none; } b:visited{ color: #FFFFFF; text-decoration: none; } b:hover{ color: #FFFFFF; text-decoration: underline; } #navBar ul b:link, #navBar ul b:visited {display: block;} #navBar ul a:link, #navBar ul a:visited {display: block;} #navBar ul {list-style: none; margin: 0; padding: 0;} /* hack to fix IE/Win's broken rendering of block-level anchors in lists */ #navBar li {border-bottom: 1px solid #EEE;} /* fix for browsers that don't need the hack */ html>body #navBar li {border-bottom: none;} /*********** #sectionLinks styles ***********/ #sectionLinks{ position: relative; margin: 0px; padding: 0px; border-bottom: 1px solid #0033CC; font-size: 70%; background-color: #112059; } #sectionLinks h3{ padding: 10px 0px 2px 10px; } #sectionLinks a { display: block; border-top: 1px solid #cccccc; padding: 2px 0px 2px 10px; } #sectionLinks a:hover{ background-color: #0033CC; } #sectionLinks2{ position: relative; margin: 0px; padding: 0px; border-bottom: 1px solid #0033CC; font-size: 130%; background-color: #112059; } #sectionLinks b { display: block; border-top: 1px solid #cccccc; padding: 2px 0px 2px 10px; /*font-size: 130%;*/ } #sectionLinks b:hover{ background-color: #0033CC; } and i have the following code in the htm page: <STYLE> BODY { scrollbar-arrow-color:094588; scrollbar-shadow-color:f0f0f0; scrollbar-face-color:f0f0f0; scrollbar-highlight-color:094588; scrollbar-darkshadow-color:094588; .style1 {font-size: 16px; background-color: #112059; background-color: #FFFFFF; } a:hover { color: #FFFFFF; } .style1 {color: #FFFFFF} b:hover { color: #FFFFFF; }.style1 {color: #FFFFFF} </STYLE> <div id="navBar"> <div id="sectionLinks"> <div id="sectionLinks2"> <h3 class="style1">Menu</h3> <ul> <li><b href="index.htm">Home</b></li> <li><b href="product.htm">Products</b></li> <li><a href="index.htm">Computer Systems</a></li> <li><a href="products.htm">Components/Peripherals</a></li> <li><a href="#">Laptops</a></li> <li><a href="#">Refurbished</a></li> <li><b href="services.htm">Services</b></li> <li><a href="#">PC Repairs</a></li> <li><a href="#">Upgrades</a></li> <li><a href="#">Home Networking</a></li> <li><a href="#">In-home training</a></li> </ul> </div> </div> </div> However this only allows hyper links to work that are defined under a href not the larger b href as I so want, I know this is complicated and long winded but can anyone lend some usefull solution to my problem? Yours greatfully. I've created navigation buttons in Photoshop by making an 818px wide document, spacing out the words, then slicing them up. My navigation division is 818px wide but when I insert the buttons I created, they don't fit. I do not have any borders around them that I can tell. Why would this happen? http://www.oharenoise.org/new/2009_news_releases.htm Hello, I have built a new navigation system for this website I'm rehabbing. Please note that the new navigation is only currently installed on the Newsroom section. I used this method (as was suggested by several people in this forum). I'm new to this method so now I need some help. The menus appear to be working but I would like some help with styling these so they look awesome. Here is a list of things I'd like to do (help with any or all of these would be appreciated): 1. I'd like to add a small border around the drop-down menu without adding a border to the img buttons I have. These images fit perfectly in the Navigation div and if a border is added around each one, the Resource button goes to a second line... very undesirable. 2. Is there a way to widen the drop-down menus? As you can see, most of the categories in each menu don't fit on one line. 3. I also is there a way to add a hover background color to the links? Thank you for your insight! The Problem: I want my logo (a gif image) to justify to the left but padding centers it. Is there a way to NOT pad one "cell" in an inline navigation bar using css without affecting the rest which follow (which are padded)? Please email me for urls to see exactly what I'm working with. Many thanks in advance! |