Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS a:link proble

  • This topic is empty.
Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #237118
    dhawkinson
    Participant

    I am building a personal website. On my contact page I have a list of links for contacting me. They are telephone, email Linkedin, etc. The default blue associated with links does not contrast enough with the background on the page.

    CSS-Tricks turned me on the a solution that involves the use of an a:link selector. It works great on the first two li items but doesn’t touch the final 4. I can find no reason in my code (though I’m sure there is one) that would explain the behavior.

    [MOD EDIT – Codedump removed]

    Help is much appreciated

    #237119
    Paulie_D
    Member

    Please make a Codepen.io demo rather than dumping a load of badly formatted code on us.

    Help us help you.

    #237134
    dhawkinson
    Participant

    Oops:

    I forgot to include the codepen link. Thanks for pointing that out Paulie_D.

    http://codepen.io/dhawkinson/pen/eJyMLV

    #237147
    Paulie_D
    Member

    Ok…but does the Codepen demo the problem…it doesn’t look like it?

    #237194
    dhawkinson
    Participant

    @Paulie_D:

    Yes if you look at the first two items in the list, they are a very dark blue, almost black. The next four are the standard default blue for links. It is a bit on the subtle side but it is visible.

    Doug

    #237195
    Atelierbram
    Participant

    @dhawkinson Do you have some user specific styles defined in your browser? Have you tried different browsers?

    The next four are the standard default blue for links.

    Checked this in DevTools to be absolutely sure, but they’re all the same #212121 value that is set on .secondary a:link.

    Related to the color calibration of the monitor/screen maybe? Can try making the page scroll (by adding ‘lorem ipsum’ or something), and scrolling up and down to see weather it’s a certain spot on the screen where the colors are off.

    #237302
    dhawkinson
    Participant

    And the correct answer is:

    .secondary a:link should be .secondary a:link, .secondary a:visited {

    #237303
    dhawkinson
    Participant

    And the correct answer is:

    .secondary a:link should be .secondary a:link, .secondary a;visited {

    #237306
    Atelierbram
    Participant

    Have been browsing with history turned off for ever (like many webdevelopers do; in order to keep some sanity). For this reason we are seeing different things when looking at visited links styled in the way you described.

    To be honest, for me this is a non-issue, since I don’t style a:link separately at all, and also omit styling visited links: just let them inherit from the a link-styles. Helps with specificity too. Something like this:

    a {
      text-decoration: none;
      color: crimson;
    }
    a:hover,
    a:active {
      text-decoration: underline;
      color: darkred;
    }
    
Viewing 9 posts - 1 through 9 (of 9 total)
  • The forum ‘CSS’ is closed to new topics and replies.