SitePoint Sponsor

User Tag List

Results 1 to 6 of 6

Thread: Link color

  1. #1
    SitePoint Member
    Join Date
    Aug 2003
    Location
    So. CA
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Link color

    Couldn't find the HTML forum.


    How do I change the color of a link on a regular HTML page?
    As a default, it is dark blue and I would like to change that.

  2. #2
    SitePoint Member
    Join Date
    Jul 2003
    Location
    So CAL
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I dont know if this is what you are looking for, but here you are
    HTML Code:
     <a href="Your link"><font color="#COLOR OF YOUR CHOICE"> LINK TEXT </font></a><font color="#FF0000">

  3. #3
    ********* Wizard silver trophy Cam's Avatar
    Join Date
    Aug 2002
    Location
    Burpengary, Australia
    Posts
    4,495
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    This is a more compliant way of doing it
    HTML Code:
    <a href="file.html" style="color: red;">Text</a>

  4. #4
    SitePoint Guru kish's Avatar
    Join Date
    Jun 2003
    Location
    UK
    Posts
    923
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    or put this in your body tag:

    Code:
     
    <body link="#ff0000" vlink="#cc0000">
    This will affect all links on your page
    The vlink specifies what colour previously visited links will show up as..
    Fast Fwd Multimedia
    Web, IT & Cloud Computing Consultancy
    Currently looking for web freelancers. Get in touch!

  5. #5
    Romans 12:2 codyrockx's Avatar
    Join Date
    Jul 2003
    Location
    Newberg, Oregon
    Posts
    422
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    you can also have the alink="#cc0000" for the active links, thats when your hovering over them.
    -cody
    Codyrobert.com - Designer and Developer

  6. #6
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,236
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by kish
    or put this in your body tag:

    Code:
     
    <body link="#ff0000" vlink="#cc0000">
    This will affect all links on your page
    The vlink specifies what colour previously visited links will show up as..
    Those are no longer valid attributes though. Use P@ckman's suggestion, or create a stylesheet ( a .css file) and add rules like these into it:
    Code:
    /*all links*/
    a {
      color: red;
    }
    /*all links when moused over*/
    a:hover {
      color: orange;
    }
    /*all links when clicked*/
    a:active {
      color: orange;
    }
    /*previously visited links*/
    a:visited {
      color: red;
    }
    Then include your stylesheet in the <head> of your HTML page like so:
    HTML Code:
    <link rel="stylesheet" href="path/to/file.css" type="text/css" media="screen" />
    Just replace the path to the stylesheet with your own.

    Hope this helps!


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
  •