Results 1 to 5 of 5

Thread: How do I override my CSS link colors?

  1. #1
    Join Date
    Aug 2004
    Location
    Goa
    Posts
    38

    How do I override my CSS link colors?

    Hello friends,

    I am creating a page using CSS where i am trying to use CSS to create the colors for the links on the page as a whole and at the same time there are many other links too but they have dark background and i want to change those links to some other colors, but don't know which code should i use it. Does anyone know what code i need to use to override my CSS link colors

  2. #2
    Join Date
    Jan 2009
    Posts
    133

    How do I override my CSS link colors?

    If you want to have override of CSS link colors then you need to use the following code

    Code:
    a1:link.selector_name { color: #colorcode; text-decoration: none; }
    a1:visited.selector_name { color: #colorcode; text-decoration: none; }
    a1:hover.selector_name { color: #colorcode; text-decoration: none; }
    a1:active.selector_name { color: #colorcode; text-decoration: none; }
    After that you can put any code which you want to style this links.

    Then for the links you want to change only some code which are as follows.

    HTML Code:
    <p><a class="selector_name" href="URL Name" title="Mouseover Description">Text Name1</a></p>
    Name your 'selector_name' whatever you like.

  3. #3
    Join Date
    Jan 2009
    Posts
    126

    Override CSS link colors

    There are many way but according to me you should use the following code directly on your page and this will override the link definition in your css.

    HTML Code:
    <a href="your url link " style="color:#colorcode;">Actual Link</a>
    If you want want to use the above code you can make the changes in your css code and add another style definition:

    HTML Code:
    .link2 a:link, .link2 a:hover; .link2 a:active { color:#color code; }
    and in your web page use this code:

    HTML Code:
    <a href="URl Link " class="link2">Actual Link</a>
    This way if you want to tweak the color you just need to change the css definition and don't have to touch your web page.

  4. #4
    Join Date
    Jan 2009
    Posts
    86

    How do I override my CSS link colors?

    There is no need to change do any thing in your HTML coding you just need to add a class attribute to this link for example <a class="special_Link" href="...">URL Name to be displayed</a>

    Then add rules in your CSS file like

    a.special_Link:link { color: white; }
    a.special_Link:visited { color: black; }
    a.special_Link:hover { color: yellow; }

  5. #5
    Join Date
    Feb 2009
    Posts
    96

    Re: How do I override my CSS link colors?

    did you try right click/properties/background or even font color?

Similar Threads

  1. Replies: 5
    Last Post: 09-04-2012, 05:12 PM
  2. How to override ToString() method in C#?
    By Linoo in forum Software Development
    Replies: 5
    Last Post: 23-02-2010, 07:54 PM
  3. How to use Override annotation in java?
    By MAHESA in forum Software Development
    Replies: 4
    Last Post: 30-01-2010, 08:25 PM
  4. Confused between override and new in C#
    By KANAN14 in forum Software Development
    Replies: 3
    Last Post: 26-11-2009, 06:47 AM
  5. How to override vista permissions
    By Reckon in forum Operating Systems
    Replies: 3
    Last Post: 01-06-2009, 11:16 AM

Tags for this Thread

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
  •  
Page generated in 1,711,625,832.00985 seconds with 16 queries