The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Change table cell highlight for first 3 rows
daverich
post Feb 23 2017, 05:12 AM
Post #1





Group: Members
Posts: 8
Joined: 28-January 17
Member No.: 26,285



Hello friends!
I have this table with row highlighting – it highlights the rows in different colours (first 3 in dark and later in blue). I wonder If I can also change the table cell highlight to yellow for the first three rows and keep the rest as it is now?
Here is the style:
QUOTE

<style>
body {
background-color: #0D0D0D;
}

tr:hover{
background: #0000F7;
color: rgb(102,102,102);
}


tr:hover td{
background: transparent !important;
}

tr td:hover {
background-color: #609 !important;
}

tr:nth-child(1):hover {
background-color: #292C31;
}

tr:nth-child(2):hover {
background-color: #292C31;
}
tr:nth-child(3):hover {
background-color: #292C31;
}

a {
color:#BFBFBF !important;
}

a {
text-decoration:none !important;
}


</style>


And the file itself:
https://jsfiddle.net/33bxg04e/
Thanking you!)
Dave
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Feb 23 2017, 06:41 AM
Post #2


Don't like donuts. Don't do MySpace.
********

Group: WDG Moderators
Posts: 17,577
Joined: 9-August 06
Member No.: 6



Is it the background color or the hover color you want to change?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
daverich
post Feb 23 2017, 03:07 PM
Post #3





Group: Members
Posts: 8
Joined: 28-January 17
Member No.: 26,285



yes - thank you!)
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Feb 23 2017, 03:29 PM
Post #4


.
********

Group: WDG Moderators
Posts: 7,558
Joined: 10-August 06
Member No.: 7



You should be able to use the same kind of nth-child rules that you already have (bu without the :hover part).
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Feb 23 2017, 03:30 PM
Post #5


Don't like donuts. Don't do MySpace.
********

Group: WDG Moderators
Posts: 17,577
Joined: 9-August 06
Member No.: 6



Background OR hover color? wacko.gif
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 22nd May 2017 - 02:19 PM