Hyperlink Colours

Discussing Html . Code , Software , other

Moderators: macek, egami, gesf

drmartin
New php-forum User
New php-forum User
Posts: 3
Joined: Wed Sep 20, 2006 1:08 pm

Hyperlink Colours

Postby drmartin » Wed Sep 20, 2006 1:18 pm

The default colour of hyperlinks is causing problems with my scheme.
Does hyperlinks have to be the same colour on one page?

Thanks. :)

User avatar
gesf
Moderator
Moderator
Posts: 1717
Joined: Sun Dec 29, 2002 5:03 am
Location: Portugal / Sweden
Contact:

Postby gesf » Wed Sep 20, 2006 4:51 pm

You can have different hyperlinks' styles in the same page.
For better help, please show us that part of your CSS.

drmartin
New php-forum User
New php-forum User
Posts: 3
Joined: Wed Sep 20, 2006 1:08 pm

Postby drmartin » Thu Sep 21, 2006 12:58 pm

:o CSS ??

I'm using plain HTML pages but would like the links in different colours :(

User avatar
gesf
Moderator
Moderator
Posts: 1717
Joined: Sun Dec 29, 2002 5:03 am
Location: Portugal / Sweden
Contact:

Postby gesf » Fri Sep 22, 2006 1:30 am

Example:

Code: Select all

<html>
<head>
<title>Style</title>
<style type="text/css">

/* Tags using classes 1 and 2 */

.1 a, a:visited, a:link, a:hover, a:active  {
   color: #1B73A3; text-decoration: none;
}

.1 a:hover  {
   color: #ff8500; text-decoration: none;
}

.2 a, a:visited, a:link, a:hover, a:active  {
   color: #000000; text-decoration: none;
}

.2 a:hover  {
   color: #aaaaaa; text-decoration: none;
}

/* Tag with id = 3 */

#3 a, a:visited, a:link, a:hover, a:active  {
   color: #000000; text-decoration: none;
}

#3 a:hover  {
   color: #aaaaaa; text-decoration: underline;
}

</style>
</head>
<body>
<div class="1">First style</div>
<div class="2">Second style</div>
<table>
  <tr>
    <td class="1">First style</td>
    <td id="3">Third style</td>
  </tr>
</table>
</body>

codere
New php-forum User
New php-forum User
Posts: 19
Joined: Sat Sep 01, 2007 3:43 am

Postby codere » Mon Sep 10, 2007 12:46 am

You can set them all to the same color if you never want the link color to change. To set the color simply put an = sign than the desired color in brackets.

tsu4five
New php-forum User
New php-forum User
Posts: 10
Joined: Sun Mar 16, 2008 3:00 pm

Re: Hyperlink Colours

Postby tsu4five » Sun Mar 16, 2008 11:29 pm

there's quite a few nice effects you can do with the fonts that way, I think that style='font-variant: small-caps' in a rather nice one.
anyway, that style sheet, you can even put it in another document, and then use it for the whole website.. CSS is really handy and just as simple as HTML


Return to “HTML Basics”

Who is online

Users browsing this forum: Bing [Bot] and 0 guests

cron