#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2003
    Posts
    2
    Rep Power
    0

    javascipt/html/css problem


    I need some help with a javascript/html/css prob I am having...

    <font class="sevenwhitearialbold"><a href="blah.html" onmouseover="style.color='black'" onmouseout="style.color='white'">TEXT</a></font>

    This code displays black text initially as the class="sevenwhitearialbold" is being ignored.

    I want it to start off white like the font class is and onmouseover turn black.

    Once I have moved the mouse over the text and moved it off it works fine... its just the first part, making it start off white.

    Any ideas?
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Nov 2001
    Posts
    765
    Rep Power
    14
    You're using 'CSS' - but not very convincingly.

    FONT is deprecated - cya - and CSS styling is the cure for it. Virtually all (almost) current browsers support simple CSS-hover classes for links.
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" 
        "http://www.w3.org/TR/html4/loose.dtd">
    
    <html>
    <head>
    <title>untitled</title>
    <style type="text/css">
    
    body {
    	background: #000;
    }
    a:link.sevenwhitearialbold {
    	font: bold 7pt arial, verdana, helvetica, sans-serif;
    	color: #fff; 
    }
    a:visited.sevenwhitearialbold {
    	font: bold 7pt arial, verdana, helvetica, sans-serif;
    	color: #fff; 
    }
    a:hover.sevenwhitearialbold {
    	font: bold 7pt arial, verdana, helvetica, sans-serif;
    	color: #000; 
    }
    a:active.sevenwhitearialbold {
    	font: bold 7pt arial, verdana, helvetica, sans-serif;
    	color: #fff; 
    }
    
    </style>
    <script type="text/javascript" language="javascript">
    
    
    
    </script>
    </head>
    <body>
    <span style="position:absolute;left:200px;top:100px;">
    <a class="sevenwhitearialbold" href="blah.html">TEXT</a>
    </span>
    </body>
    </html>
    http://www.w3schools.com/css/css_pseudo_classes.asp

    http://www.meyerweb.com/eric/css/link-specificity.html
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2003
    Posts
    2
    Rep Power
    0
    Thanks for your reply - i'am still learning

    Thanks for the links as well
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Nov 2001
    Posts
    765
    Rep Power
    14
    NP. Hang in there. Read this.

IMN logo majestic logo threadwatch logo seochat tools logo