SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Sep 2013
    Location
    Russian Federation, Tula
    Posts
    19
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    It is impossible to change the appearance (color status) links using CSS

    I can not to change the appearance (color status:link, visited, hover, active) links using CSS.

    My code in "style1.css"

    a {
    font-weight: bold;
    }

    a : link {
    color: black;
    }

    a : visited {
    color: gray;
    }

    a : hover {
    text-decoration: none;
    color: white;
    background-color: navy;
    }

    a : active {
    color: aqua;
    background-color: navy;
    }


    Thanks in advance for the help!

  2. #2
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,475
    Mentioned
    182 Post(s)
    Tagged
    6 Thread(s)
    Quote Originally Posted by Daria Alexeeva View Post
    I can not to change the appearance (color status:link, visited, hover, active) links using CSS.

    My code in "style1.css"

    a {
    font-weight: bold;
    }

    a : link {
    color: black;
    }

    a : visited {
    color: gray;
    }

    a : hover {
    text-decoration: none;
    color: white;
    background-color: navy;
    }

    a : active {
    color: aqua;
    background-color: navy;
    }


    Thanks in advance for the help!

    There should be no spaces between the selector and colon and the link state.

    e.g.
    a:link{}

    not
    a : link{}

    Spaces after a selector in CSS represent a descendant selector.


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
  •