From the course: Design the Web: Styling a Table
Unlock this course with a free trial
Join today to access over 22,600 courses taught by industry experts.
Adding hover states (rollovers) to rows - phpMyAdmin Tutorial
From the course: Design the Web: Styling a Table
Adding hover states (rollovers) to rows
- [Voiceover] So now we're going to add a Rollover Effect or a Hover Effect to the table so that if the user moves their cursor over top of the table, we can highlight the entire row that's underneath the cursor. So to do this, we're going to target the table row inside of the table body. So let's come up here and copy this row here. And we need to add this row after the row where we're targeting the nth-child for the highlighting because we want the Hover Effect to take precedence over this particular row. So after that row, we'll paste this one, add a colon, we'll add our hover pseudo-class, put in our brackets, and now the property that I want to change on hover is going to be the background-color. And we're going to set this to a semitransparent gold color. So we use rgba, put in our parentheses and semicolon. For red, we're going to set this to 231. For green, we're going to set this to 147. Zero for blue. And then .6 for the alpha. Giving us a 40% transparent color. Now to…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
Adding styles to the main table element4m 51s
-
(Locked)
Targeting all TH and TD tags4m
-
(Locked)
Setting the column widths with nth child3m 31s
-
(Locked)
Styling the table body2m 39s
-
(Locked)
Styling the table footer3m 47s
-
(Locked)
Setting styles for the first column3m 10s
-
(Locked)
Adding highlights to rows5m 54s
-
(Locked)
Adding hover states (rollovers) to rows8m 4s
-