CSS - Some Links Work, Others Do Not
Hi --
I am in the process of redesigning my website with CSS. And as I was preparing to upload it and test it (looked/worked great in NVU), I found that half of my links do not work. And ... I am a new user, so I can't post links. Gah. To be more clear, I have a menu container and a "whiteboard" container I write most of my content in. All the links in the menu container work perfectly. However, in the whiteboard, it's hit and miss. Strip out the css, and they all work, so it is the css. Try as I might, I can't figure what the problem is. Part of My CSS follows: Code: #menutop { position: absolute; width: 247px; height: 74px; background: url("menutop.gif") top left; background-repeat: no-repeat; top: 269px; left: 46px; } div#menucontainer { position: absolute; width: 200px; height:1080; background: url("menucontainer.gif"); background-repeat: repeat-y; padding-left: 15px; padding-right: 50px; top: 340px; left: 46px; } #menubottom { position: absolute; width: 247px; height:26; background: url("menubottom.gif"); background-repeat: no-repeat; top: 1420px; left: 46px; } #contact { padding-left: 20px; } div#whiteboard { position: absolute; width: 530; background-color: white; left: 310px; top: 300px; padding-bottom: 20px; border-style: dashed; border-color: #4080CA; z-index=100; } p { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 16px; padding-left: 20px; padding-right: 20px; align: left; color: #000000; } h1, h2, h3 { font-family:'Century Gothic',Futura,'URW Gothic L',sans-serif; color: #130139; padding-left: 20px; padding-right: 20px; align: center; z-index=100; } li { padding-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 16px; width: 450px; } A:link { background: #E8E8E8; font-variant: small-caps; font-family: Arial, Helvetica, sans-serif; font-color: #061C5E; font-size: 16px; font-weight: bold; } On my page, it's basically: <div id="whiteboard"> <p><a href="http://www.resafantasyarts.com/wanderingstar/WS1.zip">BOOK ONE</a> </p></div> Any help would be greatly appreciated! Similar TutorialsHi. I am thinking my two problems are related! Here are my two problems: My top nav bar links don't work in Firefox and the design breaks in IE7. Any help would be much appreciated! I have validated it, and I know the slider and video don't validate, but I still have these problems even when I take those out. Thanks so much for any help you can provide! christthesavior.org Thank you!!! edit: the sites @ www.tomaustin.dsl.pipex.com/webdev Ive been doing some googling and cant find out how it works how do i apply attributes like a:link, a: hover to an image I had some like Code: image a:hover, a:link, a:active, a:visited { border: etc.. } this does not work..it comes up with the horrid blue and purple backgrounds how do i do it? tom: ) Simple question, but i'm trying to create a decent sized space in between my links, and make them white. I can make my links white, but can't seem to change the space inbetween them. HTML Code: div id="bar-links"> <center> <div class="content box1"> <table width="500" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td colspan="4"><img src="images/barlist_01.gif" width="500" height="23" alt=""></td> </tr> <tr> <td background="images/barlist_02.gif" width="20"></td> <td background="images/barlist_03.gif" width="456"> </p> <div id="bar-links"> <h4><a href="#" title="Riley's Pub">Riley's Pub</a> <a href="#" title="Ho Down Bar"style="color: #fff">Ho Down Bar</a> <a href="#" title="Depot Square"style="color: #fff">Depot Square Bar</a> <a href="#" title="Egans Pub"style="color: #fff">Egans Pub</a> </h4> </div> </td> <td background="images/barlist_04.gif" width="24"></td> </tr> <tr> <td colspan="4"><img src="images/barlist_05.gif" width="500" height="27" alt=""></td> </tr> </table> </div> CSS Code: #bar-links { text-indent:inherit; text-align:left; } I'm going mad with this, I tested the CSS a:hover function over FF 1.0.7 and IE6, and the style file is simple: PHP Code: h3 { margin:10px; color:#636500; font-family: Arial, Helvetica, sans-serif; font-style: normal; } p { margin:10px; color:#636500; font-family: Arial, Helvetica, sans-serif; font-style: normal; } a { text-decoration: none; } a:hover { color:#636500; } a:visited { color:#cecf9c; } a:link { color:#cecf9c; } searched through the forum but seems nobody has got this problem... I just want the link to change color, I imported the css file to my html and it worked for the first time. I clicked on the link and then use brower's "Back" button to test it again, but the hover feature is not working anymore. I think it may be affected by the a:visited style, but how do I make a:hover work all the time? Thanks for helping. I have what seemed to be a simple idea but is turning out to bother me. In my style sheet i want to put a base url followed by a user id Link looks like this Code: http://mywebsite.com/this_folder/remote/html_server.php?xw_controller=hitlist&xw_action=set&target_id= Now in my html i have this Code: <table><tr><td >My name<td >Job position<td >606959150</tr> The last td that has the number in it i want to add to the end of the url posted above i cannot figure our what to put in the css to use as the main link and i want to add another td behind the last one with the number in it with the entirelink which should look like this Code: <a target="_blank" href="http://mywebsite.com/this_folder/remote/html_server.php?xw_controller=hitlist&xw_action=set&target_id=606959150">Link</a> I have to use this for multiple people each one using a unique ID# is there a simple way to do this, the reasoning behind this is that the main link changes once every few months, instead of changing all links i would like to be able to just change the one in the css file and be done with it. i hope i am explaining it correctly. Thanks ahead of time for any help u can provide I'm currently working on a website for college, but I've run into an issue I can't work out. I can't seem to get rid of the default purple box that appears around my links. The HTML: Code: <div id="homelink"><a href="index.html"></a></div> The CSS: Code: #homelink{ position:absolute; width:53px; height:17px; margin-top:25px; margin-left:70px; z-index:10; } #homelink a{ display:block; background-image:url(images/links/home.png); background-repeat:no-repeat; width:53px; height:17px; } #homelink a:hover{ display:block; background-image:url(images/links/homehover.png); width:53px; height:17px; } As you can see, I use a background image for the div and no text for the link. Clicking the background image works fine and takes me to the homepage, however I get the default visited and active link border around it. Is there any way to solve this so that no border appears? question is about CSS and links. I can get underline effect, background change, etc by using .a but i need to have more than one sort of link in my page, e.g. menu links cannot have the same effect as links in the main text. How do i set up more than two link effects? I am not sure if these links count as navigation or not, so not sure if I should be using the UL element for semantic correctness? <div id="footer_bottom" class="bold"> <a href="sitemap.php" title="Sitemap">Sitemap</a> | <a href="accessibility.php" title="Accessibility Options">Accessibility Options</a> | <a href="http://validator.w3.org/check?uri=referer;verbose=1" rel="external" title="Validate XHTML">XHTML Valid</a> | <a href="http://jigsaw.w3.org/css-validator/check/referer" rel="external" title="Validate CSS formatting">CSS Valid</a> </div> I want to have a hover effect on the links of my page. I'm using an attached stylesheet to define it. Here is the section defining the links: Code: a:link { color: red; text-decoration: none; } a:hover { color: blue; text-decoration: underline; } a:visited { color: red; text-decoration: none; } a:active { color: red; text-decoration: underline; } Normal links appear red and is not underlined. When the cursor hovers over a normal link, it appears blue and is underlined. However, visited links do not 'behave' as normal links. They appear red and are not underlined. When hovered over, they do not change color or get underlined. I want visited links to act the same. They only way I could get them to act the same was to do the following: Code: a.general:link { color: red; text-decoration: none; } a.general:visited { color: red; } a.general:hover { color: blue; text-decoration: underline; } a.general:active { color: red; text-decoration: underline; } This is the only rules IE will obey. But every link need to be defined as instances of class "general". Is there a better way of handling this? My first post Website:www.freewebs.com/weareamazing I can't figure out how to move the links that are at the top of my page (Home, Graphics, Icons, Linking Back, Credits) to the side of my table. I also want to get rid of that line that is under the links. Thank you for your help! Hi, I have CSS document like so: Code: div.menu A:link { definitions } div.menu A:visited { definitions } div.menu A:active { definitions } div.menu A:hover { definitions } And in my HTML document Code: <div class="menu"> Links are then put in here </div> But only the first Link effect works, how come? I tried Google, got few results I were looking for, I know that the Link effects has to be in certain order, and in these websites I found they were in different order tried both but no luck Thanks alot! I have set up a CSS file for a website I am building, however, when I click on the links which work correctly (at first) it goes to the desired place, if I go "back" the link turns to a larger italic font. Look here for example. http://www.burrellprolabs.com/newsite.htm if you click on one of the body copy links under "latestNEWS" then go back you will see what I mean. here is my css style for that particular part: .bodycopy { font-family: Arial, Helvetica, sans-serif; font-size: 10px; color: #575757; text-decoration: none; line-height: 13px; } .bodycopy a:link { color: #BF0000; text-decoration: none; } .bodycopy a:active { color: #BF0000; text-decoration: none; } .bodycopy a:visited { color: #BF0000; text-decoration: none; } .bodycopy a:hover { color: #969696; text-decoration: underline; Hi, If I have the following CSS: body { margin: 0px; padding: 0px; } a:link, a:visited { color: #F36706; text-decoration: none; } a:hover, a:active { color: #F36706; text-decoration: underline overline; } #siteDimention { width: 758px; margin-left: auto; margin-right: auto; padding: 0px; } How come the links in my page aren't changing from the normal blue/purple ones? I was messing around with <ul><li> type nav links, and had some issues with the bullet images I made were too large, so I made it as a background image for the <li> but <li> backgrounds didn't seem to work so well on IE. My question is this, why does everyone use <ul><li> to make their nav links when you can use less code just using <a>'s within a <div>? Here's my code example (bullet.jpg not included, it's just a 30px square I made in photoshop) Code: <html> <head> <style type="text/css"> #links li { text-indent:40px; list-style-type:none; } #links a { display:block; line-height:30px; height:30px; width:150px; background:#EEE url('bullet.jpg') no-repeat; } #links a:hover { background:#FFF url('bullet.jpg') no-repeat; } #links2 a { text-indent:40px; display:block; line-height:30px; height:30px; width:150px; background:#EEE url('bullet.jpg') no-repeat; } #links2 a:hover { background:#FFF url('bullet.jpg') no-repeat; } </style> </head> <body> <div id="links"> <ul> <li><a href="#">links</a></li> <li><a href="#">link 2</a></li> <li><a href="#">three</a></li> </ul> </div> <div id="links2"> <a href="#">links</a> <a href="#">link 2</a> <a href="#">three</a> </div> </div> </body> </html> example page: here css The links in the footer aren't available in FF (IE is OK)... I thought it had something to do with not clearing the floats, so I added that, now the red boarder(that I was using to try and get a visualization) goes around the whole content div, but the links still are clickable... I read about this somewhere, but I couldn't decipher the fix, and I can't find the page again... How do I fix this? Thanks Bryan Can anyone help me out here please? I have an urgent request and need to get this site up and running tomorrow :-( I cannot seem to hover over, mouse over any of my a:hover, link, over etc in IE. The cursor just sticks as an arrow and doesn't change to a hand. It works in Firefox fine. Thanks in advance. Lisa :-) My HTM file: ************** <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title></title> <META name="Description" content=""> <META name="Keywords" content=""> <link href="css/main.css" rel="stylesheet" type="text/css"> <!--[if IE]> <link rel="stylesheet" type="text/css" href="css/ie.css" media="screen" /> <![endif]--> <META http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <link rel="stylesheet" type="text/css" href="print.css" media="print" /> <script language="javascript" src="scripts/menu.js" type="text/javascript"> </script> </head> <body> <div id="nav-toplevel"> <div id="nav-meta"> <ul title="Top Level Navigation bar"> <li><a href="index.php" title="">home</a></li> <li><a href="aboutus.php" title="">about us</a></li> <li><a href="contact.php" title="">contacts</a></li> </ul> </div> </div> <!-- End of meta navbar --> <div id="nav-nextlevel"> <div align="center"> <div id="menu"> <ul id="menujs"> <li id=""><a href="./" title="">Item 1</a> <ul> <li id=""><a href="" title="">Thailand</a></li> <li id=""><a href="" title="">Thailand</a></li> <li id=""><a href="" title="">Thailand</a></li> </ul> <li id=""><a href="./" title="">Item 2</a> <ul> <li id=""><a href="" title="">Thailand</a></li> </ul> </li> <li id=""><a href="./" title="">Item 3</a> <ul> <li id=""><a href="" title="">Thailand</a></li> </ul> </li> <li id=""><a href="./" title="">Item4</a> <ul> <li id=""><a href="" title="">Thailand</a></li> </ul> </li> <li id=""><a href="./" title="">Item 5</a> <ul> <li id=""><a href="" title="">Thailand</a></li> </ul> </li> <li id=""><a href="./" title="">Item 6</a> <ul> <li id=""><a href="" title="">Thailand</a></li> </ul> </li> <li id=""><a href="./" title="">Item 7</a> <ul> <li id=""><a href="" title="">Thailand</a></li> </ul> <li id="selectcountry"><a href="#" title="">Item 8</a> <ul> <li id="thailand"><a href="" title="">Thailand</a></li> </ul> </li> </li> </ul> </div> </div> </div> <!-- End of top level navbar --> </div> <!-- Start of main content section --> <div id="container"> <div id="content"> <h1>Main Heading Here</h1> <h2 align="center">These Links Don't Work :-(</h2> <p> <strong>This link doesn't work<a href="." target="_self">Thailand</a><br> <br> <strong>This link doesn't work<a href="." target="_self">Thailand</a><br> <br> <strong> This link doesn't work <a href=".">Thailand</a></p> </div> <div id="contentb"> </div> <div id="footer"> <p id="info-footer"> <a href="">Doesn't Work</a> | </p> </div></div> </body> </html> ************** Here's my main.css html { font-family:verdana, arial, helvetica, sans-serif; font-size:65%; color:#555; background:#fff; /* Border Image */ background-image:url("../images/htm6l.png"); background-position:center center; background-repeat:repeat-y; } body { position:relative; width:700px; padding:15px 30px 180px 20px; margin:10px auto 10px auto; /* Page Background */ background-image:url("../images/body.png"); background-position:center center; background-repeat:repeat-y; border-bottom:1px solid #ECECEC; border-top:1px solid #ECECEC; } #banner { position:absolute; left:0; width:100%; height:120px; padding:0 !important; padding-right:50px; background-color:#FFF; /* top image */ background-image:url("../images/scuba_8.jpg"); background-position:150px 0; background-repeat:no-repeat; border-top:1px solid #ECECEC; border-bottom:1px solid #ECECEC; } #nav-toplevel { position:relative; right:290px; margin-right:-25px; } #nav-nextlevel { position:relative; right:0px; margin-right:-30px; } #nav-meta { position:absolute; right:0; top:1px !important; top:0px; } #nav-meta ul { display:inline; margin:0; padding:0; } #nav-meta ul li { display:inline; margin:0 !important; margin-left:3px; padding:1px; background-color:#F8FBFF; border:1px solid #ccc; border-top:none; list-style:none; } #nav-meta a { padding-left:2px; padding-bottom:2px; font-size:0.94em; letter-spacing:0.04em; color:#888; text-decoration:none; margin:0 !important; margin-right:-2px; } #nav-meta li:hover { border-top:1px dashed #CACACA; } #nav-meta a:hover { background-color:transparent !important; text-decoration:none !important; background-color:#fff; text-decorationverline; } #menu ul, #menu li, #ClearFloat { margin:0px; padding:0px; } #menu{ position:absolute; display:block; top:122px; margin:0px 0px 0px 99px; width:auto; font-family:verdana,Georgia, serif; font-size:11px; list-style-type:none; float:left; z-index:300; } #menu ul li , #menu ul li ul li { position:relative; font-family:verdana,Georgia, serif; list-style-type:none; float:left; z-index:500; } #menu ul li ul { position:absolute; display:none; font-family:verdana,Georgia, serif; } #menu ul li a, #menu ul li a:link, #menu ul li a:visited { display:block; font-size:11px; font-family:verdana,Georgia, serif; color:#888; text-decoration:none; margin-left:3px; margin-top:0px; padding-bottom:3px !important; padding-left:4px; padding-right:4px; padding-top:3px; background-color:#FFF; border:1px solid #ccc; border-top:none; line-height:10px; } #menu ul li.over ul, #menu ul li:hover ul { display:block; font-size: 11px; font-family:verdana,Georgia, serif; text-align:left; width:100px; background-color:transparent !important; text-decoration:none !important; } #menu ul li a:hover { display:block; font-size:11px; font-family:verdana,Georgia, serif; color:#ccc; } #menu ul li ul li a:hover { display:block; font-size:11px; font-family:verdana,Georgia, serif; } #container { position:relative; top:160px; height:100%; background-color:#F8FBFF; /* Footer Image */ background-image:url("../images/scuba_footer.jpg"); background-position:right bottom; background-repeat:no-repeat; margin-bottom:10px; z-index:100; } #content { position:relative; width:700px; background:transparent; } #content p { font-size:1.08em; line-height:1.4em; padding:6px 11px 13px 25px; margin:0 15px 1.1em 0; background-image:url("../images/shadow2.png"); background-position:bottom center; background-repeat:no-repeat; } #content ol, #content ul{ font-size:1.08em; line-height:1.4em; padding:6px 11px 13px 25px; margin:0 13px 1.1em 0; background-image:url("../images/shadow2.png"); background-position:bottom center; background-repeat:no-repeat; } #content li { list-style-type:square; margin: 0px 0px 0px 15px; } #contentb { position:relative; width:525px; background:transparent; } #contentb p { font-size:1.08em; line-height:1.4em; padding:6px 11px 13px 20px; margin:0 15px 1.1em 0; background-image:url("../images/shadow.png"); background-position:bottom left; background-repeat:no-repeat; } #contentb ol, #contentb ul { font-size:1.08em; line-height:1.4em; padding:6px 11px 13px 40px; margin:0 13px 1.1em 0; background-image:url("../images/shadow.png"); background-position:bottom left; background-repeat:no-repeat; } #contentb li { list-style-type:square;} h1,h2,h3,h4,h5,h6 { height:auto !important; height:30px; margin-top:0; margin-left:11px; font-family:century gothic, serif; letter-spacing:0.04em; background-repeat:no-repeat; border-bottom:1px solid #ECECEC; background:transparent; } h1 { width:680px; padding-top:0.3em; padding-left:2px; font-size:14px; color:#4a74c0; background-image:url("../images/sand23.png"); background-position:bottom left; background:transparent; } h4 { border-bottom:0px solid #ECECEC; } h2,h3,h4,h5,h6 { font-size:12px; font-size:1.3em; color:#4a74c0; padding-left:25px; background-position:bottom left; } h2,h3, h4, h5, h6 { width:660px; } h1:first-letter ,h2:first-letter { font-size:1.6em; text-transform:uppercase; } h3:first-letter ,h4:first-letter ,h5:first-letter ,h6:first-letter { font-size:1.5em; text-transform:uppercase; } #footer { position:absolute; bottom:3px !important; bottom:0px; right:23px; width:100%; font-size:0.94em; } #info-footer { position:absolute; right:-32px; } a:link { color:#888; text-decoration:underline; } a:visited { color:#888; text-decoration:underline; } a:hover { color:#ff490d; text-decoration:none; } a:active { color:#000; text-decoration:none; } ************************* Here's my menu.js startList = function() { if (document.all&&document.getElementById) { navRoot = document.getElementById("menujs"); 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; ******************** here's my ie.css#container { z-index:-1; } I would really appreciate any help. Thanks again Lisa. Excuse me but i am a little thick on this one: How do I create different colored link style for say a: 1. navigation bar 2. footer bar 3. main body Does making classes make sense in this situation doug Can some explain (briefly) how one goes about specifying CSS styles for different link areas in a page. for example, I want navigation links to have a different set of "rules" than footer links. ted |