473,405 Members | 2,344 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,405 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 1993
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.