You develop an HTML application that contains a table that displays a list of products.
The table is defined with the following HTML markup:
You must style the table to look like the following image:
You need to implement the CSS selectors to select the rows that must have a blue background.
Which CSS selector should you use?
A. tr : first-line, tr :last-child
B. tr [line |=0, 1, 3]
C. tr: nth-child (0) : in-range, tr: nth-child (3) : in-range
D. tr: nth-child(3n+1) {background-color : blue;}
Explanation:
The correct answer is C!
http://www.briefmenow.org/microsoft/which-css-selector-should-you-use-2/
0
3
No, it should be “tr:first-of-type, tr:last-of-type”.
2
0
I doubt C. ‘nth-child’ is not zero-indexed (starts from 1). And ‘:in-range’ pseudo class is used to test if value of input is within min-max range.
0
0