CSS - Menu Link Issue
Similar TutorialsHello I'm new to the forum and I'm hoping someone can help me with a question. I predominantly use html to build websites but I'm finding that the topic of frames is frowned upon. So I'm wondering if I can use CSS instead but their is a catch....here's the situation... I've built a page that has a .swf movie that I made with Swish V2. The last scene includes a link to another page that includes a jpg with an image map. I'd like to have this link with the image map load in the first page so that the viewer is forced to go through the swf movie to get to the image map each time. The problem I'm having is that the Swish program allows the link to work in the same window but it shows the address as being the link and not the parent windows address. These pages are used for roleplay in a chat server. If I leave it as it stands now they will be able to save the page with the image map on it and avoid the macromedia movie each time. Is there something that can be done? Thanks in advance for your time. mira I'm having another link issue. I have images in a <ul> that are links. (It's a gallery using Slimbox + Mootools). Everything looks fine in FF. However, in IE, I get these little maybe 2 or 3 pixel (width) link lines that are blue and then purple when visited. They are not on every image. In fact, my <ul> has 4 lines of six images, and the little extra pixel lines fall in the margin after the first image of every line. Here's my CSS: Code: a img { border: 0 none; margin: 4px 4px 10px 4px; text-decoration: none; } a:hover img { border: 1px solid #e5cb43; margin: 3px 3px 9px 3px; } ul.photog { list-style-position: outside; padding: 0px; margin: 0px; border: none; background-color: #979089; width: 850px; text-align: center; margin-right: auto; margin-left: auto; } li.photog { margin: 0px; padding: 0px; list-style-type:none; } Strange thing is that I have another <ul> that uses identical code to that one and doesn't have the problem I am experiencing with this one. Any help would be greatly appreciated. Thanks in advance! Hi, I have this in the html and so on for each page <div id="nav"> <ul> <li class="current"><a href="one.htm">one</a></li> <li><a href="two.htm">two</a></li> <li><a href="three.htm">three</a></li> </ul> </div> Then css: #nav ul li.current a{ background:#CCCCCC; color:#000000; } But I don't want the first page's link to change colour until it is clicked. Otherwise the menu comes up with first link always active before anything has been selected. It looks wrong. Is there anyway around this in css? Thanks, jdl i am trying to find anywhere that may have something to describe a collapse and expand link menu in css. I can't find one that use's mainly css it is all javascript of somekind does anyone know where i could find one. http://www.dudley.nhs.uk/ In I.E. 7, when I click on the links in the right hand menu, the whole link/block turns white. Although it doesn't strictly matter (as person gets redirected), I'd like to resolve the issue as it's quite annoying. It works when the code is: Code: .gallery a { text-decoration:none; display:block; padding:5px 5px 5px 20px; width:125px; color:black; background: url(../images/arrow.gif) no-repeat 10px 10px; /* Light green */ } .gallery a:hover { background: url(../images/arrowr.gif) no-repeat 11px 10px; /* Dark green*/ color:black; } but fails when I add a background colour such as: Code: .gallery a, .gallery a:visited { text-decoration:none; display:block; padding:5px 5px 5px 20px; width:125px; color:black; background: #cfc url(../images/arrow.gif) no-repeat 10px 10px; /* Light green */ } .gallery a:hover { background: #3c0 url(../images/arrowr.gif) no-repeat 11px 10px; /* Dark green*/ color:black; } Any clues? Thanks! Hi, new here, and to CSS. I have read several of the posts regarding menu problems, but could not find one similar to my problem. Here is my development site, the code should be accessible (or I could post it if you prefer): PaHiker.com It works with all of the browsers except IE (of course). If you move the cursor over Chapters the secondary menu opens up below Chapters (which is what I want) and you can click on the item. In IE the secondary menu opens up, but as soon as the cursor is moved off of the primary item the secondary menu closes. Any help would be appreciated. Thanks, Mike Please Delete Hello everone, i just joined today in this community and looking forward to enjoying here for a quite long time as i want to develop myself with css. I have a horizontal menu which is based on an image that has three layers: unvisited link, hover link, active link. but somehow i cant get my active links to work and cant understand where im making a mistake. you can find php and css codes below. and i appreciate any single comments suggestions. PHP code: Code: <?php $block = ( is_front_page() ? 'h1' : 'div' ); // arguments for wp_list_pages $list_args = k2_get_page_list_args(); // this function is pluggable ?> <?php echo "<$block class='blog-title'>"; ?> <a href="<?php echo get_option('home'); ?>/" accesskey="1"><?php bloginfo('name'); ?></a> <?php echo "</$block>"; ?> <p class="description"><?php bloginfo('description'); ?> <ul id="menu"> <li id="home"><a href=""<?php if(is_home() || is_single() || is_category() || is_tag() || is_author() || is_year() || is_month()) { echo ' class="active"'; }?>>home</a></li> <li id="archives"><a href="?page_id=2"<?php if(is_page('archives')) echo ' class="active"'; ?>>archives</a></li> <li id="news"><a href="?page_id=35"<?php if(is_page('news')) echo ' class="active"'; ?>>news</a></li> <li id="contact" class="last<?php if(is_page('contact')) echo ' active"'; ?>"><a href="?page_id=31">contact</a></li> CSS code: Code: #menu { list-style: none; padding: 0; margin: -105px 25px; width: 332px; height: 30px; background: url('images/menu.gif'); position: relative; } ul#menu li { width: 80px; height: 30px; padding: 0 4px 0 0; text-indent: -900px; float: left; } ul#menu li.last { padding: 0; } ul#menu li a, ul#menu li a:visited, ul#menu li a:hover { display: block; width: 80px; height: 30px; background: transparent url('images/menu.gif') no-repeat; outline: none; } ul#menu li#home a, ul#menu li#home a:visited { background-position: 0 0; } ul#menu li#archives a, ul#menu li#archives a:visited { background-position: -84px 0; } ul#menu li#news a, ul#menu li#news a:visited { background-position: -168px 0; } ul#menu li#contact a, ul#menu li#contact a:visited { background-position: -252px 0; } ul#menu li#home a:hover { background-position: 0 -30px; } ul#menu li#archives a:hover { background-position: -84px -30px; } ul#menu li#news a:hover { background-position: -168px -30px; } ul#menu li#contact a:hover { background-position: -252px -30px; } .home ul#menu li#home a, .home ul#menu li#home a:visited, .home ul#menu li#home a:hover { background-position: 0 -60px; cursor: default; } .archives ul#menu li#archives a, .archives ul#menu li#archives a:visited, .archives ul#menu li#archives a:hover { background-position: -84px -60px; cursor: default; } .news ul#menu li#news a, .news ul#menu li#news a:visited, .news ul#menu li#news a:hover { background-position: -168px -60px; cursor: default; } .contact ul#menu li#contact a, .contact ul#menu li#contact a:visited, .contact ul#menu li#contact a:hover { background-position: -252px -60px; cursor: default; } i think the problem may be with the last 4 lines of CSS code because they are related to the active links but dont know how i can find out the problem. thank you for any single suggestions and comments. Hello there, im new to the forums. decided to register because im having a bit of a problem with CSS/HTML.(pretty inexperienced with css). Heres what i wanna do: I have a social website where users can register and comment on things etc. I want to show a drop down menu as soon as users hover their mouse over a user name. So i took this script: http://javascript-array.com/scripts...drop_down_menu/ And modified it. But i cant figure out how to make it work if the user name is surrounded with other text, it automatically creates a new line. Heres my code: Code: <html> <head> <style> <!-- #sddm a { display: block; } #sddm span { position: absolute; visibility: hidden; margin: 0; padding: 0; background: #3D97D6; border: 1px solid #5970B2} #sddm span a { position: relative; display: block; margin: 0; padding: 5px 10px; width: auto; white-space: nowrap; text-align: left; text-decoration: none; background: #3D97D6; color: #FFF; font: 11px arial} #sddm span a:hover { background: #2875DE; color: #FFF} --> </style> <script type="text/javascript"> // Copyright 2006-2007 javascript-array.com var timeout = 500; var closetimer = 0; var ddmenuitem = 0; // open hidden layer function mopen(id) { // cancel close timer mcancelclosetime(); // close old layer if(ddmenuitem) ddmenuitem.style.visibility = 'hidden'; // get new layer and show it ddmenuitem = document.getElementById(id); ddmenuitem.style.visibility = 'visible'; } // close showed layer function mclose() { if(ddmenuitem) ddmenuitem.style.visibility = 'hidden'; } // go close timer function mclosetime() { closetimer = window.setTimeout(mclose, timeout); } // cancel close timer function mcancelclosetime() { if(closetimer) { window.clearTimeout(closetimer); closetimer = null; } } // close layer when click-out document.onclick = mclose; </script> </head> <body> <span id="sddm"> <a href="#" onmouseover="mopen('m1')" onmouseout="mclosetime()">This is a username</a> <span id="m1" onmouseover="mcancelclosetime()" onmouseout="mclosetime()"> <img src="linktoav" alt="avatar" /> <font color="#ffffff"><b>Koen</b></font></a> <a href="#">Add as Friend</a> <a href="#">Send message</a> <a href="#">View Profile</a> <a href="#">Report</a> </span> </span> this text comes after the username </body> </html> So i hope its clear what i wanna do, i always find it hard to explain things 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 I have a menu where the submenu li's have a blue/darker blue background color and hover color. I have one set of submenu items where I would like to change the background and hover colors for that set only, but haven't been successful in writing the second set of code, the original colors still show up Here's the part of my styles for the list that I'm trying to change.. Code: /* original backgrounds for the menu */ ul.menu li ul li a { background: #ccc; color: #000; padding-left: 20px; } ul.menu li ul li a:hover { background: #aaa; border-left: 5px #000 solid; padding-left: 15px; } Is it the way I tried to rename the style? Code: /* change backgrounds to shades of green for one sub menu */ .green ul.menu li ul li a { background: #afe4bf; color: #000; padding-left: 20px; } .green ul.menu li ul li a:hover { background: #88b796; border-left: 5px #000 solid; padding-left: 15px; } thanks in advance for any help, Kathy Hi all new member, just learning css! need help targeting my menu system? Html so far! -its a dynamic menu system, and i have no control of the naming system of the li Code: <div class="nav-container"> <ul id="nav"> <li> <a href="http://localhost/">Home</a> </li> <li class="level0 nav-1 level-top first"> <a class="level-top" href="http://localhost/mens.html"> <span>Mens</span> </a> </li> <li class="level0 nav-2 level-top"> <a class="level-top" href="http://localhost/womens.html"> <span>Womens</span> </a> </li> </ul> </div> I need to target the li classes - each one individual to bring in a different image for each when rolled over. Css i have for one of the examples:- .level0 nav-2 level-top li { float:left; padding:0px; font-size:14px; font-weight:bold; color:#000; text-transform:uppercase; background-image:url("navigation.gif"); width:85px;} .level0 nav-2 level-top li a:hover { color:#FDDD15; background-image:url("navigation.gif"); width:85px;background-position:0 -20px;} But its not right, not targetting it! - what is the correct path to target the different nav's? Thanks Hello, I'm building a portfolio for a close friend of mine and I REALLY can't seem to figure out this navigation menu she wants me to make. I have the menu in place but the drop down is both WAY too far to the right and UNDER the slideshow. Could anyone kindly show me how to get that stupid thing to appear UNDER the 'Galleries' section and ABOVE the slideshow? http://saranicolephotography.com/ Thanks! Can somebody please look at the following drop-down menu and tell me why it breaks in IE...it works fine in Mozilla/FF... In IE, the problem is that the sub-menus do not completely appear in front of their parent menus...they should be on top of their parent menus...like i said, it works in FF, so you can switch bewteen browsers to see the difference.... Thanks for any help. __________________ R.J. www.mediamogulsweb.com Everything works perfect expect one thing. When a mouse hovered on a link, dropdown links appear. Problem here is when I move my mouse towards the new links, they disappear before I reach them. Did I explain the problem well? No. Try the link. Menu at the top here. http://www.refinethetaste.com/html/ Code: <style type="text/css"> /* ================================================================ This copyright notice must be kept untouched in the stylesheet at all times. The original version of this stylesheet and the associated (x)html is available at http://www.cssplay.co.uk/menus/elegant1.html Copyright (c) 2005-2008 Stu Nicholls. All rights reserved. This stylesheet and the associated (x)html may be modified in any way to fit your requirements. =================================================================== */ #navigation { float:left; height:26px; width:776px; background:url(http://www.refinethetaste.com/html/THEMES/default/images/bg_mainmenu_off.gif); } #navigation .menu {padding:0; margin:0; list-style:none; font-size:16px;} #navigation .menu table {border-collapse:collapse; height:0; width:0; margin:0 -4px -1px 0;} #navigation .menu li {float:left; margin:0 5px;} #navigation .menu li a {display:block; float:left; color:#FFFFFF; height:26px; text-decoration:none;} #navigation .menu li a.current {font-weight:bold; border-bottom:3px solid #9d0808; cursor:text;} #navigation .menu li:hover {position:relative; z-index:100;} #navigation .menu li a:hover {position:relative; z-index:100; border-bottom:3px solid #aaa;} #navigation .menu ul {position:absolute; left:-9999px; top:38px; width:140px; padding:0; margin:0; list-style:none;} #navigation .menu ul li {margin:0;} #navigation .menu ul li a {width:140px; height:20px; color: #000000; font-size:14px; border:0; text-align:right;} #navigation .menu ul li a:hover { border:0;} #navigation .menu ul ul {position:absolute; margin-left:100%; top:0; padding:0; margin:0; list-style:none;} #navigation .menu :hover ul {right:0; left:auto;} #navigation .menu :hover ul ul {left:-9999px; width:130px; padding-left:10px; } #navigation .menu li ul :hover ul {left: 140px; height:20px; right:auto;} #navigation .menu li ul li ul li a { color:#000000; font-size:12px; text-align:left; } </style> Hi, My sub sub-menu won't work properly in IE regardless of version, but in FF and Chrome it's good to go. Basically, the sub sub-menu is covered up by the sub-menu. The sub sub-menu also appears when rolling over the main menu option, Resources, but it's blank. Weird stuff here. Here's a link: http://loganrealtyinc.com/ You can see what I'm talking about by mousing over: Resources > Things to Do See how the sub sub-menu options, thus Things to Do covers up Norton Museum and so forth? Any ideas? As always, thanks in advance. Hey everyone, The page below displays perfectly in both IE6 and Firefox, but in IE7 my navigation disappears and the right navigation in the header is all crunched together. livedifference dot com slash test slash home I'm not really a CSS guru, but I've tried clearing floats via tons of methods and adding random things, but nothing seems to work. Any help would be GREATLY appreciated, I really need to get this up and running. Thanks, Brad I'm working with a superfish menu. I re-colored the images and replaced them with the old images in the css. For some reason, the menu-btn_rtur is not showing up. I want it there when the menu is inactive, like you see right when you go to the home page. At some obvious points, it will need the sub indicator arrow. My client wants to launch today, so I'm really under the gun and need help-- eternally grateful to anyone who responds. Smile Site Link:staging.phantasea.net/cpi/ CSS I added: Code: #navigation-menu ul.sf-menu > li > a { background: url(http://staging.phantasea.net/cpi/wp-content/uploads/2012/05/menu-btn_rtur.png) top right no-repeat; display: block; padding: 0 20px 0 0; color: #ffffff; text-decoration: none; border:0 none; cursor: pointer; } #navigation-menu ul.sf-menu > li > a > span { background: url(http://staging.phantasea.net/cpi/wp-content/uploads/2012/05/menu-active-btn_ltur.png) top left no-repeat; display: block; padding: 10px 0 10px 20px; color:#FFF; line-height:22px; } #navigation-menu ul.sf-menu > li > a.sf-with-ul { background: url(http://staging.phantasea.net/cpi/wp-content/uploads/2012/05/menu-with-arrow-btn_rtur.png) top right no-repeat; padding: 0 26px 0 0; } #navigation-menu ul.sf-menu > li > a > span.sf-sub-indicator { /* give all except IE6 the correct values */ background: url(http://staging.phantasea.net/cpi/wp-content/uploads/2012/05/menu-active-with-arrow-btn_rtur.png) top right no-repeat; padding: 10px 0 10px 0; } #navigation-menu ul.sf-menu > li.current-menu-item > a.sf-with-ul, #navigation-menu ul.sf-menu > li.current_page_item > a.sf-with-ul { background: url(../images/menu-active-with-arrow-btn_rtur.png) top right no-repeat; } ORIGINAL CSS: Code: /* Begin Main Navigation Menu */ #navigation-menu { position:absolute; right:20px; top:5px; font-size:14px; height:40px; } .navigation-menu { position:relative; z-index:22; } #main-menu { background: url(../../common-images/main-menu-btm-border.png) repeat-x scroll 50% 100% transparent; width: 100%; position:relative; z-index:101; height:56px; margin-bottom:-6px; } #dropdown-holder { display: block; position:relative; } #navigation-menu > ul { padding-top: 7px; } #navigation-menu > * { padding:0; margin:0; font-size: 1em; } #navigation-menu ul.sf-menu { padding: 10px 0 0 0; } #navigation-menu ul.sf-menu > li { background:none; list-style: none; float: left; margin: 0 0 0 -3px; } #navigation-menu ul.sf-menu a.default-cursor { cursor: default; } #navigation-menu ul.sf-menu > li > a { background: url(../images/menu-btn_r.png) top right no-repeat; display: block; padding: 0 20px 0 0; color: #E8E8E8; text-decoration: none; border:0 none; cursor: pointer; } #navigation-menu ul.sf-menu a { line-height: 1.2em; padding:8px 16px; } #navigation-menu ul.sf-menu a > span.sf-sub-indicator { top: 17px !important; } #navigation-menu ul.sf-menu ul a > span.sf-sub-indicator { top: 0.9em !important; } #navigation-menu ul.sf-menu > li > a > span { background: url(../images/menu-btn_l.png) top left no-repeat; display: block; padding: 10px 0 10px 20px; color:#FFF; line-height:22px; } #navigation-menu ul.sf-menu > li { margin: 0 0 0 -3px; } #navigation-menu ul.sf-menu > li > a.sf-with-ul { background: url(../images/menu-with-arrow-btn_r.png) top right no-repeat; padding: 0 26px 0 0; } #navigation-menu ul.sf-menu > li > a.sf-with-ul:hover { background: url(../images/menu-active-with-arrow-btn_r.png) top right no-repeat; padding: 0 26px 0 0; } #navigation-menu ul.sf-menu > li > a > span.sf-sub-indicator { /* give all except IE6 the correct values */ background: url(../images/menu-active-with-arrow-btn_r.png) top right no-repeat; padding: 10px 0 10px 0; } #navigation-menu ul.sf-menu > li > a:hover { background: url(../images/menu-active-btn_r.png) top right no-repeat; color: #FFF; text-decoration: none; } #navigation-menu ul.sf-menu > li > a:hover span { background: url(../images/menu-active-btn_l.png) top left no-repeat; color: #555; } #navigation-menu ul.sf-menu > li.current-menu-item > a, #navigation-menu ul.sf-menu > li.current_page_item > a { background: url(../images/menu-active-btn_r.png) top right no-repeat; color: #6A6A6A; text-decoration: none; } #navigation-menu ul.sf-menu > li.current-menu-item > a > span, #navigation-menu ul.sf-menu > li.current_page_item > a > span { background: url(../images/menu-active-btn_l.png) top left no-repeat; color: #00717D; } #navigation-menu ul.sf-menu > li.current-menu-item > a > span:hover, #navigation-menu ul.sf-menu > li.current_page_item > a > span:hover { background: url(../images/menu-active-btn_l.png) top left no-repeat; color: #555; } #navigation-menu ul.sf-menu > li.current-menu-item > a.sf-with-ul, #navigation-menu ul.sf-menu > li.current_page_item > a.sf-with-ul { background: url(../images/menu-active-with-arrow-btn_r.png) top right no-repeat; } /* End Main Navigation Menu */ Hi I have modified a menu that used tables to now use CSS, it works fine but I can't get the layout to work (I'm learning). Each button has it's own div. I need the menu to go horizontally, not vertically, can anyone help please? jinx-inc.co.uk/development/menu.html Css - jinx-inc.co.uk/development/css.txt Html - jinx-inc.co.uk/development/html.txt I'm happy to provide whatever's needed if someone requires it to help! Thanks |