PDA

View Full Version : Different formated links on 1 page


wolfmanbc
11-24-2008, 07:46 PM
I am trying to set up links on a page and I have my links set in the page properties and now all my links have the same properties. I want to have two different sets of link properties. How do I achieve this?

Ricky55
11-24-2008, 09:20 PM
you do this with CSS, create two classes that define how you want your links to look, then apply these classes to the links.

For example your CSS would look like

<style type="text/css">
.linkOne a {
color: red;
text-decoration: none;
}

.linkOne a:hover {
color: teal;
text-decoration: underline;
}

.linkTwo a {
color: green;
text-decoration: none;
}

.linkTwo a:hover {
color: yellow;
text-decoration: underline;
}
</style>

and your html

<body>
<p class="linkOne"><a href="#">I am a Link</a></p>
<p class="linkTwo"><a href="#">I am a second link</a></p>
</body>

wolfmanbc
11-24-2008, 09:54 PM
ive tried putting the css code into the html code and that didnt work. where would i insert the css code?

Ricky55
11-24-2008, 10:05 PM
The whole page looks like this


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>
<style type="text/css">
.linkOne a {
color: red;
text-decoration: none;
}

.linkOne a:hover {
color: teal;
text-decoration: underline;
}

.linkTwo a {
color: green;
text-decoration: none;
}

.linkTwo a:hover {
color: yellow;
text-decoration: underline;
}
</style>



</head>

<body>
<p class="linkOne"><a href="#">I am a Link</a></p>
<p class="linkTwo"><a href="#">I am a second link</a></p>
</body>
</html>

Corrosive
11-25-2008, 07:02 AM
ive tried putting the css code into the html code and that didnt work. where would i insert the css code?

You really need to go and read up on and understand CSS.

Ricky55
11-25-2008, 12:38 PM
what made you say that Corrosive?

putting the CSS code into the html code?

Corrosive
11-25-2008, 05:20 PM
what made you say that Corrosive?

putting the CSS code into the html code?

Yes, basically. If you don't know where to put CSS code then my suggestion is to go and do some research on it.

Nice example of how to use it btw.