473,785 Members | 2,458 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Why is a table cell adapting one class over another?

NoPeasHear
23 New Member
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}
Sep 17 '06 #1
4 2006
drhowarddrfine
7,435 Recognized Expert Expert
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 Recognized Expert Moderator Expert
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.
Sep 17 '06 #3
NoPeasHear
23 New Member
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 Recognized Expert Moderator Expert
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
24504
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 'stretch'</td> <td valign="top" width="300">some data that won't 'stetch'</td> </tr> </table>
4
2444
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 when the window is rezised the menu stands at the same position and with the same size. My question is: is there a way to modify those parameters dinamically to match window size, and how is that made, or is there
4
8938
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 appear/desappear using javascript. Is it solvable that way? I tried to rely on CSS but i didn't find any good info on this matter...
1
3552
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 black for example). I am dynamically creating the LinkButton controls and adding them into the table cell and I've also hooked up an event handler for each LinkButton's Click event. This all works fine. Now in the Link Button's Click event...
2
4964
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 non-visible columns at the front? I have a page with a dynamic table. The table has some visible columns and some non-visible columns. The style "hide" is .hide { display:none; } <table id="SelectedList">
7
4827
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 expandable row, the hidden row is made visible with css. The problem is when i sort the rows, the hidden rows get sorted as well which i don't want and want to be moved (while sorting) relative to their parent rows. The following is my complete html code...
5
13809
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 drag&drop on the same page (which was not possible). Now i´ve a new concept of the script, more object oriented. I´ve also commented the whole code so you guys can easier understand it engine. What exactly we need when trying to make a column drag &...
5
4957
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 there are, it crashes. There are currently 6 columns, and I only want 4. How do I remove the last two (discount and date)? Here is a link: http://www.jaredmoore.com/tablesorter/docs/salestable.html Here is some jquery js that I think...
0
9645
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9480
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10325
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10091
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9950
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6739
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5381
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3645
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.