Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Nov 2002
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    CSS a:link not working

    Hi guys, I was wondering if someone could help me out with this simple problem. This is the link part of my CSS code

    <style type="text/css">

    A:link
    {text-decoration:none; color:#FFFFFF}


    A:visited
    {text-decoration:none; color:#21EDFF}


    A:hover
    {text-decoration:none; color: #FFFFFF}

    On my website, the links work perfectly as according to my css script when i hover and when they're visited. However, the main A:link isn't white, instead it's like the normal browser link colour, blue and is underlined.

    This is my html coding

    <HTML>
    <HEAD>
    <TITLE>..::Cambodia::..</TITLE>
    <LINK href="stylesheet_kvetch2.css" rel="stylesheet" type="text/css">

    </HEAD>
    <BODY>




    <div id=layer1 style="position:absolute; top:20; left:150; width:700; height:300; padding:2px; background-color:white;">

    <img src="http://www.freewebs.com/kvetch2/cambodia.jpg">

    </div>


    <div id layer2 style="position:absolute; top:320; left:152; width:700; height:500; z-index:1; padding:5px; border: #000000 2px solid; background-color:#000000; overflow:auto;">


    <div align="right"><a href="http://freewebs.com/kvetch" style="cursor:crosshair;"> | Home </a> <a href=http://www.freewebs.com/kvetch2/pictures.htm" style="cursor:crosshair;"> | Pictures | </a> </div>

    Can anyone help? Sorry if it's kind of messy! Thanks!

  • #2
    Senior Coder Nightfire's Avatar
    Join Date
    Jun 2002
    Posts
    4,265
    Thanks
    6
    Thanked 48 Times in 48 Posts
    If you're linking the css to the page via the link tag, then don't use <style></style> in the css file.

    Replace what you got with
    Code:
    a {
      text-decoration:none; 
      color:#FFFFFF
    }
    
    a:visited{
      color:#21EDFF
    }
    And if all your links are to be crosshairs, then add this into the a{}

    cursor: crosshair

    example:

    Code:
    a {
      text-decoration:none; 
      color:#FFFFFF;
      cursor:crosshair;
    }
    
    a:visited{
      color:#21EDFF
    }

  • #3
    New to the CF scene
    Join Date
    Nov 2002
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Oh! I put <style></style> in my css script! Thanks so much! It works now! Yay!

  • #4
    me'
    me' is offline
    Senior Coder
    Join Date
    Nov 2002
    Location
    Warwickshire, England
    Posts
    1,229
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Also, A:link (should) be different to a:link, as XML is case sensitive. If you're using HTML, it shouldn't matter, though.
    David House - Perfect is achieved, not when there is nothing left to add, but when there is nothing left to take away. (Antoine de St. Exupery).
    W3Schools | XHTML Validator | CSS Validator | Colours | Typography | HTML&CSS FAQ | Go get Mozilla Now | I blog!


  •  

    Posting Permissions

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