473,287 Members | 1,926 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,287 software developers and data experts.

Why is a table cell adapting one class over another?

NoPeasHear
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.html">resume</a>
<a href="thumbnails.html">thumbnails</a>
<p></td>
</tr>


my stylesheet...

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

.menu
a {text-decoration:none;}
a:link{color:#FFFBDB}
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:#454A0D}
a:visited{color:#454A0D}
a:hover{color: #241B02}
a:active {color:#241B02}
Sep 17 '06 #1
4 1991
drhowarddrfine
7,435 Expert 4TB
Can't tell but remove that stray <p> and see what happens. Otherwise, need a link or the complete code.
Sep 17 '06 #2
Banfa
9,065 Expert Mod 8TB
This is wrong

[html]
.menu
a {text-decoration:none;}
a:link{color:#FFFBDB}
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:#FFFBDB}

and then later

a:link{color:#454A0D}

The second definition for the a:link style overrides the first all itmes of type a:link use the second rule.
Sep 17 '06 #3
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.
Sep 18 '06 #4
Banfa
9,065 Expert Mod 8TB
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
Sep 18 '06 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

61
by: Toby Austin | last post by:
I'm trying to replace <table>s with <div>s as much as possible. However, I can't figure out how to do the following… <table> <tr> <td valign="top" width="100%">some data that will...
4
by: Dacian | last post by:
Hi, I´m trying to place a javascript navigation menu inside a cell of a table in my page, the problem is that the constructor of the menu object has parameters for menu positioning and size and...
4
by: Konrad Viltersten | last post by:
As it isnow i have to use a syntax for my tables as: <table class = "some" border> and/or <table class = "some" noborder> Now, what i'd like to do is to make that border-thingy...
1
by: Thanks | last post by:
I have a routine that is called on Page_Init. It retrieves folder records from a database which I display as Link Buttons in a table cell. I set the table cell's bgcolor to a default color (say...
2
by: dschectman | last post by:
This appears to be a feature of IE JavaScript. I am running IE 6.0 with the latest patches from Microsoft. Are there any workarounds other than re-coding the source HTML to place all the...
7
by: Kamal | last post by:
Hello all, I have a very simple html table with collapsible rows and sorting capabilities. The collapsible row is hidden with css rule (display:none). When one clicks in the left of the...
5
by: Romulo NF | last post by:
Greetings, I´m back here to show the new version of the drag & drop table columns (original script ). I´ve found some issues with the old script, specially when trying to use 2 tables with...
5
by: jrod11 | last post by:
hi, I found a jquery html table sorting code i have implemented. I am trying to figure out how to edit how many colums there are, but every time i remove code that I think controls how many colums...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.