Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder
    Join Date
    Jun 2002
    Location
    -27° 28' 22" , 153° 1' 22"
    Posts
    135
    Thanks
    0
    Thanked 0 Times in 0 Posts

    External css file not working correctly

    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;}
    </style>

    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>
    </td>

  • #2
    208
    208 is offline
    New to the CF scene
    Join Date
    Jul 2002
    Location
    oz land
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thumbs up how to fix it

    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
    ----------
    www.freewebservices.tk

  • #3
    Regular Coder
    Join Date
    Jun 2002
    Location
    NL
    Posts
    421
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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>

  • #4
    Regular Coder
    Join Date
    Jun 2002
    Location
    -27° 28' 22" , 153° 1' 22"
    Posts
    135
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Cool Deleted the <style> tags

    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.

    Cheers.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •