Links in CSS?

liunx

Guest
When using the A:Link only the links to other pages or web sites are affected by the properties of A:Link. Links to other parts of the same web page do not use the attributes of the A:Link (For example...when you use the a name="". I may have to create a class for it but I am not sure why it doesn't treat all links the same. If anyone knows why this is it would be great to know how to get around it. :)<!--content-->Have you tried setting a "general" one before the ALINK? Or it may be considered as an ACTIVE value considering the link is on the current document.<br />
<br />
A {styles here;}<br />
A:LINK {styles here;}<br />
A:ACTIVE {styles here;}<!--content-->I hope I understand what you're saying. I think what is happening is that links to other parts of the same page are considered "visited" since you're already there. So you need to set attributes for visited links as well. Make sure you do them in the right order. Here is the proper order for attributing links:<br />
  1. <br />
    a:link - the selector for normal links<br />
    a:visited - the selector for visited links<br />
    a:hover - the selector for links being hovered over by the mouse (not supported in Netscape 4.x)<br />
    a:active - the selector for active links<br />
    [/list=1]<br />
    Let me know if this solves you're problem.<br />
    <br />
    Doog Xela<!--content-->Sorry if I was not clear. :( I meant if you have a link to an anchor on the same page the A:LINK atrributes and properties are not being used by these links. For example, if I have a section of my web page that I would like users to be able to link to, I set up a link to that section using the <A name="#section"> format to link to that section. The A:LINK and A:HOVER do not seem to take effect on this link. Thanks.<!--content-->Many thanks to HTMLITE...you solved my problem, home slice. I had no idea that the order of CSS elements mattered! The A:HOVER was before my A:LINK so I put A:HOVER after the A:LINK and now it works fine. Thanks for everyone's input.<!--content-->..actually Doogxela solved my problem. Sorry, I am just a rookie.<!--content-->i've seen and had that problem myself.<br />
    <br />
    the bad news is that you may end up having to change the look of ALL the visited links.<br />
    <br />
    the good news is that by using classes, you can easily get around it by defining a separate class just for the local anchors.<br />
    <br />
    for example:<br />
    <br />
    .class a:visited {attribute:properties;}<br />
    <br />
    <a name="name" class="class">name</a><!--content-->p.s., as was recently pointed out here by someone (was it Doc? Scoutt?) doing it that way means that you can also do<br />
    <br />
    <span class="class"><br />
    <a name="name">name</a><br />
    <a name="name2">name2</a><br />
    <a name="name3">name3</a><br />
    </span><br />
    <br />
    (i think i got that right, anyway :P )<!--content-->
 
Back
Top