Archived topic
WP Show Posts border :last-child
5 replies · Started by William on August 3, 2021
Aloha,
If I can add a right border with:
.wp-show-posts-single {
border-right:1px red solid;
}
How can I kill the last right border?
????:last-child {
border-right:none;
}
Sorry to bug you with this - I've tried everything I know.
Mahalo :)
Bill
Hi William,
Normally you can exempt the last child from having a border right by doing it like this:
.wp-show-posts-single:not(:last-child) {
border-right:1px red solid;
}
But if it doesn't work, can you link me to the page in question containing the WPSP list you're trying to add this in?
Aloha Elvin,
Thanks so much for your reply.
Your CSS adds a border to each element - including the last one.
I just made this page for you - I'm trying to hide the border on "Elvin – Test Post 3"
https://socialsciences.manoa.hawaii.edu/wp-show-posts-border/
Happy Friday!
Have a terrific weekend! And thank you again!
Bill
Hi there,
try the last-of-type selector instead like so:
.wp-show-posts-single:not(:last-of-type) {
border-right: 1px red solid;
}
That did it :)
I'm watching a tutorial on :last-of-type now.
Much thanks to you both for your help and guidance!!
Love learning new stuff :)
Much appreciated.
Bill
Awesome - glad to hear that!