Click to See Complete Forum and Search --> : css through an external CSS to a link


calrockx
11-21-2003, 02:49 PM
i was trying to apply some css style to a link through an external style sheet, but it won't work. i know the page is linked to the external sheet, so it's in the code.

this is on the external sheet:



font.topnav a {font-family:arial; font-size:10pt; letter-spacing:1px; color: black; text-decoration:none}

a.topnav2 {font-family:arial; font-size:10pt; letter-spacing:1px; color: black; text-decoration:none}

td.topnav a {font-family:arial; font-size:10pt; letter-spacing:1px; color: black; text-decoration:none}


those are the three i tried. finally it worked with the td one, but is it possible to apply css with a CLASS via font. or a.?





here's the code i applied it to, with the class in the td tag, not the font tag like i had hoped would work.

<TD CLASS="topnav"><FONT><A HREF="../../index.htm">HOME</A></FONT></TD>

Jish
11-21-2003, 04:19 PM
I tried this and it works fine for me:


<style type="text/css">

.myClass {
color: black;
font-family: Arial;
font-size: 10pt;
letter-spacing: 1px;
text-decoration: none; }

</style>

</head>
<body>

<a href="http://forums.webdeveloper.com/" class="myClass">My Link</a>!<br />
<font class="myClass">My Font</font>

calrockx
11-21-2003, 08:05 PM
even that one didn't work for me. i just want to be able to put the class name in the FONT tag and have it refer to the external .css sheet. anyone?

Paul Jr
11-21-2003, 09:58 PM
http://htmlgoodies.com/tutors/ie_style.html
http://www.w3schools.com/css/css_howto.asp
http://www.westciv.com/style_master/academy/css_tutorial/introduction/integration.html

I'm too lazy to search for anymore...

ray326
11-21-2003, 11:35 PM
Originally posted by calrockx
even that one didn't work for me. i just want to be able to put the class name in the FONT tag and have it refer to the external .css sheet. anyone?
Forget you ever heard of a <font> tag and then think about how you should do it. <font> is deprecated, not needed and anachronistic when you're using CSS. Put the font definitions into the tag selectors like:

a {font-family:arial; font-size:10pt; letter-spacing:1px; color: black; text-decoration:none}

Paul Jr
11-22-2003, 09:38 AM
Originally posted by ray326
Forget you ever heard of a <font> tag and then think about how you should do it. <font> is deprecated, not needed and anachronistic when you're using CSS...

Eh...<font> tag, you say? What is this <font> tag?

:D


Anyhoo, I agree.
<font> == Bad!