Why is a table cell adapting one class over another?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • NoPeasHear
    New Member
    • Aug 2006
    • 22

    Why is a table cell adapting one class over another?

    My problem - the first cell of my table is adapting the .nav class rather than .menu class that I am assigning it. How can I fix it?

    My code starts out as the following...

    <link href="../basicstyle.css" rel="stylesheet " type="text/css">
    <style type="text/css">
    <!--
    .style1 {color: #CCCC99}
    -->
    </style>
    </head>
    <body>

    <table width="780" border="0" align="center" cellpadding="0" cellspacing="0" >
    <tr>
    <td align="center" class="menu">
    <a href="01.html"> home </a>
    <a href="bio.html" >bio</a>
    <a href="resume.ht ml">resume</a>
    <a href="thumbnail s.html">thumbna ils</a>
    <p></td>
    </tr>


    my stylesheet...

    body {background-color:#454A0D}
    a {text-decoration:none ;}
    a:link{color:#2 41B02}
    a:visited{color :#241B02}
    a:hover{color: #FFFBDB;text-decoration:none ;
    }
    a:active {color:#454A0D}

    .menu
    a {text-decoration:none ;}
    a:link{color:#F FFBDB}
    a:visited{color :#FFFBDB}
    a:hover{color: #241B02;text-decoration:none ;
    }
    a:active {color:#FFFBDB}


    .caption {
    font-family:Verdana, Arial, Helvetica, sans-serif;
    font-size: 12px;
    font-weight:normal;
    color:#241B02}

    .credit{
    font-family:Verdana, Arial, Helvetica, sans-serif;
    font-size:10px;
    font-style:italic;
    text-transform:none;
    font-weight:normal;
    color:#241B02
    }

    .nav
    a {text-decoration:none ;}
    a:link{color:#4 54A0D}
    a:visited{color :#454A0D}
    a:hover{color: #241B02}
    a:active {color:#241B02}
  • drhowarddrfine
    Recognized Expert Expert
    • Sep 2006
    • 7434

    #2
    Can't tell but remove that stray <p> and see what happens. Otherwise, need a link or the complete code.

    Comment

    • Banfa
      Recognized Expert Expert
      • Feb 2006
      • 9067

      #3
      This is wrong

      [html]
      .menu
      a {text-decoration:none ;}
      a:link{color:#F FFBDB}
      a:visited{color :#FFFBDB}
      a:hover{color: #241B02;text-decoration:none ;
      }
      a:active {color:#FFFBDB}
      [/html]
      it needs to be
      [html]
      .menu a {
      text-decoration:none ;
      }
      .menu a:link {
      color:#FFFBDB;
      }
      .menu a:visited {
      color:#FFFBDB
      }
      .menu a:hover {
      color: #241B02;
      text-decoration:none ;
      }
      a:active {color:#FFFBDB}
      [/html]i.e. .menu needs to appear before every style rule to which it is supposed to apply. A similar things needs doing for .nav

      Iyou your current style sheet you have

      a:link{color:#F FFBDB}

      and then later

      a:link{color:#4 54A0D}

      The second definition for the a:link style overrides the first all itmes of type a:link use the second rule.

      Comment

      • NoPeasHear
        New Member
        • Aug 2006
        • 22

        #4
        So if you have more than one set of rules for links in your stylesheet you need to place the class name in front of each specification?

        Thanks for your help.

        Comment

        • Banfa
          Recognized Expert Expert
          • Feb 2006
          • 9067

          #5
          Originally posted by NoPeasHear
          So if you have more than one set of rules for links in your stylesheet you need to place the class name in front of each specification?
          Basically, Yes

          Comment

          Working...