My style for <a> is confused! HELP!!!!!!

Discussion in 'CSS' started by mayurkirti, Aug 16, 2006.

  1. #1
    This is the style for 'amenu' used for anchor tag:
    
    .amenu {color: #ffffff; font-size:8pt; font-family:verdana; font-weight:bold; text-decoration:none;}
    Code (markup):
    Heres what I have for the unstyled anchor tag:

    a:link	{
    	color: #ff3300;
    	text-decoration: underline; 
            }
    
    a:visited	{
    	color: #ff3300;
    	text-decoration: underline; 
    	}
    	
    a:active	{
    	font-color: #ff3300;
    	text-decoration: underline; 
    	}
    	
    a:hover	{
    	color: #CC6600;
    	text-decoration:none;
    	}
    Code (markup):
    These both are written in the same external file called xyz.css. Now the problem is, 'amenu' works fine when I dont include the second part in .css file (the one for unstyled <a> tag). But when I write both of them together, the 'amenu' style is overridden by the other style and hyperlinks with style 'amenu' appear with all the charecteristics of simple <a>.

    This is an example of how I am using the 'amenu'

    <td class='menu1'><a class ='amenu' href='http://www.xyz.umd.edu/' ><font size="-2">Overview</font></a></td>
    Code (markup):
    Please, pleease, pleeeease help :(
     
    mayurkirti, Aug 16, 2006 IP
  2. daboss

    daboss Guest

    Messages:
    2,249
    Likes Received:
    151
    Best Answers:
    0
    Trophy Points:
    0
    #2
    try create a div id and then define

    #main {...}
    #main a:link {...}
    #main a:visited {...}
    #main a:hover {...}

    then put the <div id="main"> and </div> tags around your code... it should pick up the styles for anchors defined for the div
     
    daboss, Aug 16, 2006 IP
  3. mayurkirti

    mayurkirti Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    wow, you are great!

    It worked!

    If you dont mind, can u try solving another one:

    This is the code that I wrote so that the table row bgcolor changes when the mouse hovers over it. It works great with IE. Any solutions for mozilla?

    td.menu1 {
    background-color:#CC0000;
    }
    
    td.menu1:hover {
    background-color:#ea0000;
    }
    Code (markup):
     
    mayurkirti, Aug 16, 2006 IP