SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Member
    Join Date
    Feb 2003
    Location
    Illinois
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question a:link display issues

    Having a problem with the link states displaying correctly in my browser, I.E. 6.0. The main issue is the a:link color does not display. On a new page (none of the links have been previously selected), the links all display in the a:visited color. This is a sample what I've written in the style sheet.

    A:link { color: blue; }
    A:visited { color: purple; }
    A:hover { color: yellow; }
    A:active { color: red; }

    When I open the pages in the browser, the links display in purple instead of the blue. Both the yellow hover and red active states display correctly. Another odd thing is that I can see the blue a:link color correctly in my Dreamweaver workspace, but the browser preview is another story. The pages always load with purple links. I’m stumped.

    Need a solution. Any suggestions or tips about anchor tag styling will be appreciated. Thanks.

  2. #2
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,556
    Mentioned
    183 Post(s)
    Tagged
    6 Thread(s)
    Hi,

    They look ok to me.

    If you have been testing the links out then they will be visited links and will then show in purple. I believe the browser determines visited links by looking in the browsers history list. If you go into your browsers settings and delete your history and then see if the links revert to their normal colour (I'm sure they will).

    (The links will show in DW as blue because it's not a browser and doesn't know that the links have been visited.)

    Hope this helps.

    Paul

  3. #3
    SitePoint Member
    Join Date
    Feb 2003
    Location
    Illinois
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for pulling me out of the fog, Paul! Followed your suggestion, flushed the history and the cache. Everything worked fine after that. Even tried multiple sets of links, and they all work fine too.

    Respectfully,
    JayZee

  4. #4
    SitePoint Member
    Join Date
    Apr 2003
    Location
    Honolulu, Hawaii
    Posts
    14
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by jayzee
    Having a problem with the link states displaying correctly in my browser, I.E. 6.0. The main issue is the a:link color does not display. On a new page (none of the links have been previously selected), the links all display in the a:visited color. This is a sample what I've written in the style sheet.

    A:link { color: blue; }
    A:visited { color: purple; }
    A:hover { color: yellow; }
    A:active { color: red; }

    When I open the pages in the browser, the links display in purple instead of the blue. Both the yellow hover and red active states display correctly. Another odd thing is that I can see the blue a:link color correctly in my Dreamweaver workspace, but the browser preview is another story. The pages always load with purple links. I’m stumped.

    Need a solution. Any suggestions or tips about anchor tag styling will be appreciated. Thanks.
    I've noticed that A:link {color} doesn't work in my browser (IE 5.5)
    This works A: {color}
    Anyone else notice this?

  5. #5
    gingham dress, army boots... silver trophy redux's Avatar
    Join Date
    Apr 2002
    Location
    Salford / Manchester / UK
    Posts
    4,838
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    nope, works fine for me. can you provide the full CSS and HTML of the page that seems to break A:link for you ?
    re·dux (adj.): brought back; returned. used postpositively
    [latin : re-, re- + dux, leader; see duke.]
    WaSP Accessibility Task Force Member
    splintered.co.uk | photographia.co.uk | redux.deviantart.com

  6. #6
    SitePoint Member
    Join Date
    Apr 2003
    Location
    Honolulu, Hawaii
    Posts
    14
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by redux
    nope, works fine for me. can you provide the full CSS and HTML of the page that seems to break A:link for you ?
    Every page I make with A:link {text-decoration:none;} shows an underline in my IE 5.5 browser. Here's an example code:

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
    <html>
    <head>
    <title>Example</title>
    <style><!--
    A:link {
    text-decoration:none;
    }
    A:hover {
    color:red;
    text-decoration:none;
    background-color:yellow;
    }
    -->
    </style>
    </head>

    <body bgcolor="white" text="black" link="blue" vlink="purple" alink="red">

    <p><a href="#"><b>This Link Should Not Be Underlined</b></a></p>
    </body>
    </html>

  7. #7
    gingham dress, army boots... silver trophy redux's Avatar
    Join Date
    Apr 2002
    Location
    Salford / Manchester / UK
    Posts
    4,838
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    why are you using <!-- --> to "hide" your styles ? it's not javascript...and yes, it will cause the styles to fail, as html comments are not part of the CSS language.
    this is actually uncannily similar to this thread here http://www.sitepointforums.com/showt...hreadid=104833
    re·dux (adj.): brought back; returned. used postpositively
    [latin : re-, re- + dux, leader; see duke.]
    WaSP Accessibility Task Force Member
    splintered.co.uk | photographia.co.uk | redux.deviantart.com

  8. #8
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,556
    Mentioned
    183 Post(s)
    Tagged
    6 Thread(s)
    Hi,

    I don't think it's got anything to do with the comment tags. Your code works in IE5.5 and IE6 with or without the comment tags.

    The problem is related to the first post above funnily enough. You haven't defined a: visited so every time you check your page except for the very first time your text will be underlined. Define a:visited {text-decoration:none;} in your stylesheet and everything will be ok.

    You also have links defined in your body tags, why not define them properly in the style sheet?

    Get rid of this stuff :
    <body bgcolor="white" text="black" link="blue" vlink="purple" alink="red">

    (Concerning the comment tags around all the styles in the stylesheet, Dreamweaver MX inserts these automatically and the reason they give is that it hides the code from old browsers that don't understand CSS. Whether this is true or not I don't know. I also understand that xhtml in the future may well interpret comment tags as comments so all the styles could be hidden if comments are used (in the future). So I guess it's probably better to leave them out.)

    Hope this helps

    Paul


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •