Hyperlink Colours

Discussing Html . Code , Software , other

Moderators: macek, egami, gesf

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

Post by 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.

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

Post by 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

Post by 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

Post by 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

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest