SitePoint Sponsor

User Tag List

Results 1 to 14 of 14
  1. #1
    SitePoint Wizard
    Join Date
    Jun 2005
    Posts
    1,438
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Making links the same colors

    To make email links and website links on a site to always be the same color, (when they're not hovered on), wouldn't the syntax below work please ?

    Code:
    a:link, a:visited, a:active {
    color:#000;
    font-weight:normal;
    }
    a:hover {
    background-color:#000; 
    color:#fff; 
    text-decoration:none;
    }
    Any help appreciated.

    Dez.

  2. #2
    Utopia, Inc. silver trophy
    ScallioXTX's Avatar
    Join Date
    Aug 2008
    Location
    The Netherlands
    Posts
    9,080
    Mentioned
    153 Post(s)
    Tagged
    2 Thread(s)
    Just be sure you could make the first line

    a, a:link, a:visited, a:active

    (add the a tag)

  3. #3
    SitePoint Wizard
    Join Date
    Jun 2005
    Posts
    1,438
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Thumbs up

    That's brilliant, problem solved.

    Many thanks.

  4. #4
    . shoooo... silver trophy logic_earth's Avatar
    Join Date
    Oct 2005
    Location
    CA
    Posts
    9,013
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    You forgot :focus be kind to keyboard users!
    Logic without the fatal effects.
    All code snippets are licensed under WTFPL.


  5. #5
    billycundiff{float:left;} silver trophybronze trophy RyanReese's Avatar
    Join Date
    Oct 2008
    Location
    Whiteford, Maryland, United States
    Posts
    13,622
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    Logic, when you just use standard "a" for CSS it includes all the pseudo classes in it AFAIK.
    Always looking for web design/development work.
    http://www.CodeFundamentals.com

  6. #6
    . shoooo... silver trophy logic_earth's Avatar
    Join Date
    Oct 2005
    Location
    CA
    Posts
    9,013
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by RyanReese View Post
    Logic, when you just use standard "a" for CSS it includes all the pseudo classes in it AFAIK.
    I suppose I should have been a little more clear. But I meant using :focus as the OP has done for :hover. :focus is for keyboards :hover is for mice. Ya?
    Logic without the fatal effects.
    All code snippets are licensed under WTFPL.


  7. #7
    billycundiff{float:left;} silver trophybronze trophy RyanReese's Avatar
    Join Date
    Oct 2008
    Location
    Whiteford, Maryland, United States
    Posts
    13,622
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    Yes but theoretically, if people are using hte keyboard to navigate then they probably don't have a mouse/can use one (most people use mouses)

    So logically it would be the same experience as a "hover" . So thus you don't really have to differentiate hover/focus (theoretically of course )
    Always looking for web design/development work.
    http://www.CodeFundamentals.com

  8. #8
    . shoooo... silver trophy logic_earth's Avatar
    Join Date
    Oct 2005
    Location
    CA
    Posts
    9,013
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    No you don't have to differentiate between hover...but there is no :focus at all and it will appear just like the others (except :hover).
    Logic without the fatal effects.
    All code snippets are licensed under WTFPL.


  9. #9
    Utopia, Inc. silver trophy
    ScallioXTX's Avatar
    Join Date
    Aug 2008
    Location
    The Netherlands
    Posts
    9,080
    Mentioned
    153 Post(s)
    Tagged
    2 Thread(s)
    Quote Originally Posted by RyanReese View Post
    Logic, when you just use standard "a" for CSS it includes all the pseudo classes in it AFAIK.
    I keep forgetting how and when, but sometimes when you define only the standard "a" (and so not the psuedo classes) one of the IE (I think it was 6) versions doesn't apply it correctly to all links, you really have to supply all pseudo classes.

  10. #10
    billycundiff{float:left;} silver trophybronze trophy RyanReese's Avatar
    Join Date
    Oct 2008
    Location
    Whiteford, Maryland, United States
    Posts
    13,622
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by ScallioXTX View Post
    I keep forgetting how and when, but sometimes when you define only the standard "a" (and so not the psuedo classes) one of the IE (I think it was 6) versions doesn't apply it correctly to all links, you really have to supply all pseudo classes.
    IE6 has that issue sometimes, although that is quite a rare occurance and it should be dealt with on the spot . It's always good to differentiate the pseudo classes though.
    Always looking for web design/development work.
    http://www.CodeFundamentals.com

  11. #11
    Robert Wellock silver trophybronze trophy xhtmlcoder's Avatar
    Join Date
    Apr 2002
    Location
    A Maze of Twisty Little Passages
    Posts
    6,316
    Mentioned
    60 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by RyanReese View Post
    Yes but theoretically, if people are using hte keyboard to navigate then they probably don't have a mouse/can use one (most people use mouses)
    Off Topic:

    Don't let Tommy see that he'd freak-out; he is Mr "keyboard navigation-shortcut" guy.


    Well, it depends upon platform too as to whether a person can navigate with a mouse input-device or decides to do so. Obviously it will then effect things like if :hover will be available - like was mentioned above.

  12. #12
    billycundiff{float:left;} silver trophybronze trophy RyanReese's Avatar
    Join Date
    Oct 2008
    Location
    Whiteford, Maryland, United States
    Posts
    13,622
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by xhtmlcoder View Post
    Off Topic:

    Don't let Tommy see that he'd freak-out; he is Mr "keyboard navigation-shortcut" guy.
    lol-I'm in no way saying this should be done, it was all just theoretical . It made sense in my head. I awlays differentiate pseudo classes for links
    Always looking for web design/development work.
    http://www.CodeFundamentals.com

  13. #13
    SitePoint Wizard
    Join Date
    Jun 2005
    Posts
    1,438
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Many thanks for the input, so how is it left - focus or no focus ? ?

  14. #14
    billycundiff{float:left;} silver trophybronze trophy RyanReese's Avatar
    Join Date
    Oct 2008
    Location
    Whiteford, Maryland, United States
    Posts
    13,622
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    Add the :focus on
    Always looking for web design/development work.
    http://www.CodeFundamentals.com


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
  •