Reputation: 71
I have multiple H3 headings on a page. I wanted to display a black line before each H3 on the page except the first h3 and I have implemented following rule:
#Webappcontent_2346 > h3:before {
margin: 0 auto;
content: "";
width: 98%;
height: 1px;
border: none;
background: #000;
display: inline-block;
}
This rule displays black line before each h3, however I'm not sure which rule I can use to hide the line before first h3.
Any ideas?
Upvotes: 1
Views: 327
Reputation: 5810
The Demo below:
h1:not(:first-child){
color:red;
}
<div class="abc">
<h1>Hello</h1>
<h1>Hello</h1>
<h1>Hello</h1>
<h1>Hello</h1>
<h1>Hello</h1>
</div>
Upvotes: 0
Reputation: 1976
You have to use :
#Webappcontent_2346 > h3:not(:first-child) {
margin: 0 auto;
content: "";
width: 98%;
height: 1px;
border: none;
background: #000;
display: inline-block;
}
Upvotes: 2