The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

> can't select a range for hr element with nth-of-type
Astoach167
post 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>


User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Posts in this topic


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: 21st February 2020 - 02:13 PM