View Full Version : External css file not working correctly

Jul 5th, 2002, 08:15 AM
When I use the below external css file all the <a class="toplinks"> are not formatted as per the attributes. Or if 'bottomlinks' is declared at the top of the css then it happens to that class and so on. I am not sure why this does it, 'cause when the code is in the page it works, any ideas?

<style type="text/css">
.toplinks {color: #FFFFFF; font-family: Arial, Helvetica, sans-serif; font-size: 7pt;}
.toplinks:active {color: #FFFFFF;}
.toplinks:hover {color: #FFCC00;}
.bottomlinks {color: #000066; font-family: Arial, Helvetica, sans-serif; font-size: 7pt;}
.bottomlinks:active {color: #000066;}
.bottomlinks:hover {color: #FFCC00;}
.ticker {color: #000066; font-family: Arial, Helvetica, sans-serif; font-size: 9pt;}
.ticker:hover {color: #FFCC00;}

This is the code where I use 'toplinks':

<td align="right" valign="top" width="55%"><a class="toplinks"
href="sitemap/sitemap.htm" target="_top">Site map</a> | <a
class="toplinks" href="news/recentnews.htm" target="_top">News
&amp; Events</a> | <a class="toplinks"
href="aboutus/contactus.htm" target="_top">Contact us</a> | <a
class="toplinks" href="aboutus/survey.htm"
target="_top">Survey</a> | <a class="toplinks"
href="http://www.qld.gov.au/" target="_blank">www.qld.gov.au</a>

Jul 5th, 2002, 08:51 AM
in the external css file, do not add the style tag, just start with:
.toplinks { color: #ff0000; font-family: verdana }
and so on.
save it as a .css file.
in the file that links to .toplinks, add the link to the css file:
< html >
< head >
< title >Title< /title >
< link rel="stylesheet" type="text/css" href="extstylefile.css" media="screen" >
< /head >
< body >
< a href="whereever.htm" class=".toplinks">To somewhere< /a >
< /body >
< /html >
if it doesn't work, reply

Jul 5th, 2002, 02:09 PM
Hi, as for the toplinks, just an example below. Calling the class from the cell instead of the link. There are other ways.

.toplinks {color: #FFFFFF; font-family: Arial, Helvetica, sans-serif; font-size: 7pt;}
.toplinks A:link { color: #FFFFFF; }
.toplinks A:visited { color: #FFFFFF; }
.toplinks A:hover { color: #FFCC00; }
.toplinks A:active { color: #FFFFFF; }

<TD align="right" valign="top" width="55%" class="toplinks"><A href="sitemap/sitemap.htm" target="_top">Site map</A> | <A href="news/recentnews.htm" target="_top">News
& Events</A> | <A href="aboutus/contactus.htm" target="_top">Contact us</A> | <A href="aboutus/survey.htm" target="_top">Survey</A> | <A href="http://www.qld.gov.au/" target="_blank">www.qld.gov.au</A></TD>

Jul 8th, 2002, 02:41 AM
Thanks for the help and extra info guys, all I had to do was delete the <style> tags and the file worked. Funny how simple it is to miss someone that is right in your face.