can't select a range for hr element with nth-of-type |
can't select a range for hr element with nth-of-type |
Astoach167 |
Jan 12 2020, 09:50 PM
Post
#1
|
Group: Members Posts: 1 Joined: 12-January 20 Member No.: 27,119 |
the 1st hr to the 3rd hr element should be red, but its not, can someone tell me why?
CODE <!DOCTYPE html> <html> <head> <style> hr:nth-of-type(n+1):nth-of-type(-n+3){ background: red; } </style> </head> <body> <hr /> <p>The first paragraph.</p> <p>The second paragraph.</p> <p>The third paragraph.</p> <hr /> <hr /> <hr /> <p>The fourth paragraph.</p> </body> </html> |
Christian J |
Jan 14 2020, 01:40 PM
Post
#2
|
. Group: WDG Moderators Posts: 9,661 Joined: 10-August 06 Member No.: 7 |
Me I just copied the OP's code.
|
Lo-Fi Version | Time is now: 28th April 2024 - 02:00 AM |