Click to See Complete Forum and Search --> : Question on another type of code


Dark Dragon
08-22-2003, 12:32 PM
I got this code to add a "Space Out" effect to text links..here is the code:

<html>
<head>
<style>
a:hover
{
letter-spacing: 2;
}
</style>
</head>

<body>
<a href="default.asp">Mouse over this link</a>
</body>

</html>

Now here goes the inquiry..suppose I have several text links that I want to apply this code to, do I just keep repeating the <a href="default.asp">Mouse over this link</a> on every line that my text link will be?

I know it is a silly and basic question but I am having some problems getting it to line up and function the way I need it to....Thanks a bunch :D

spufi
08-22-2003, 12:44 PM
The way you have it defined, it will affect any normally defined text link when a person hovers over it.

Dark Dragon
08-22-2003, 12:50 PM
So I just need to enter the whole code once and it will affect all my text links???
Thanks a bunch!

pyro
08-22-2003, 01:30 PM
Note that you need to specify a type attribute for the <style> tag, like this: <style type="text/css">

Dark Dragon
08-22-2003, 01:43 PM
Umm..you sure Pyro? I tested it in a browser and it seemed to work okay...maybe this W3school site isn't so great if they do not show you the complete code.....well...thanks Pyro..I will do that then.

pyro
08-22-2003, 01:53 PM
Yes, I'm sure...

Out of curiosity, where on w3schools.com did it tell you to use <style></style>

Dark Dragon
08-22-2003, 02:23 PM
There is that "examples" area in the DHTML section and it had code for such things...and the code they gave is exactly what I have pasted here..I didn't know it was incorrect though..I just took it at face value..oh and thanks for the help..I learned something already! :D

spufi
08-22-2003, 02:51 PM
I want to add that w3schools does not give examples of valid code to test out. Yes, you can get them to work in their "try it out" section, and they may work in your browser. It still doesn't mean it's valid. (insert valid code vs. what works in my browser rant) Any code they give you, you will want to run through W3C's validator to make sure it is technically valid code. w3schools is not a part of W3C.

Dark Dragon
08-22-2003, 04:13 PM
Any code they give you, you will want to run through W3C's validator to make sure it is technically valid code.

Yes..therein lies the original problem..I used their code exactly..one was a XHTML page template and another was a drop down menu.

The only thing I did was alter the page background and the color and text of the menu. I ran it through their validator and it FAILED! One code I tried had 41 errors in it..and this was after I had followed W3schools instructions...HA!