I don’t want to the first two images get the custome style I wrote.
<!-- HTML -->
<div class="entry">
<img src="image1.jpg">
<img src="image2.jpg">
<img src="image3.jpg">
<img src="image4.jpg">
<img src="image5.jpg">
</div>
I’ve just try this:
.entry img:not(:first-of-type):not(:nth-of-type(2)) {
margin: 0 auto 20px !important;
display: block;
width: 350px;
height: 250px;
}
But it’s not working
And these:
.entry img:not(:nth-child(-n+2)) {
margin: 0 auto 20px !important;
display: block;
width: 350px;
height: 250px;
}
.entry img:not(:first-child):not(:nth-child(2)) {
margin: 0 auto 20px !important;
display: block;
width: 350px;
height: 250px;
}
3
Answers
Here’s how you can do it:
Try this css selector, to select all images except the first two:
Call first ones
image
and othersimg
.img{} and image{} shall be different.