Comments on: :last-child https://css-tricks.com Tips, Tricks, and Techniques on using Cascading Style Sheets. Fri, 22 Mar 2019 21:38:43 +0000 hourly 1 https://wordpress.org/?v=6.5.5 By: Rian https://css-tricks.com/almanac/selectors/l/last-child/#comment-1680015 Fri, 22 Mar 2019 21:38:43 +0000 http://css-tricks.com/?page_id=14222#comment-1680015 What is the least complicated way to select the last-child but only if its not the only-child?

In other words, is there a selector simpler than :last-child:not(only-child)?

]]>
By: Abhivirus https://css-tricks.com/almanac/selectors/l/last-child/#comment-1669132 Wed, 27 Feb 2019 10:32:55 +0000 http://css-tricks.com/?page_id=14222#comment-1669132 How to use pseudo-classes on the last li element.

]]>
By: Geoff Graham https://css-tricks.com/almanac/selectors/l/last-child/#comment-1652022 Fri, 07 Sep 2018 14:03:50 +0000 http://css-tricks.com/?page_id=14222#comment-1652022 In reply to Trishah.

Awesome, and nice solution!

]]>
By: Trishah https://css-tricks.com/almanac/selectors/l/last-child/#comment-1652015 Thu, 06 Sep 2018 21:52:07 +0000 http://css-tricks.com/?page_id=14222#comment-1652015 Hi Geoff. Thank you for the tip. I can see where your solution could really change the workflow when using the Visual Editor.

After thinking about this more, I devised a CSS solution that works. As the endmark was being placed inside the last paragraph of the section AND the last paragraph of the blockquote, I only needed to stop it inside the blockquote like this:

.content p:last-child::after {
font-family: 'Font Awesome 5 Pro';
content: '\f06c';
margin:0 0 0 15px;
color: #009acc;
}
.content blockquote p:last-child::after {
content: '';
}

Thanks again!

]]>
By: Geoff Graham https://css-tricks.com/almanac/selectors/l/last-child/#comment-1652008 Thu, 06 Sep 2018 14:48:54 +0000 http://css-tricks.com/?page_id=14222#comment-1652008 In reply to Trishah.

Hey Trishah! This function should prevent WordPress from auto-adding paragraph tags:

Careful, though, because this will remove paragraphs from the entire content. Here’s the WordPress reference for the filter:

https://codex.wordpress.org/Function_Reference/wpautop#Disabling_the_filter

]]>
By: Trishah https://css-tricks.com/almanac/selectors/l/last-child/#comment-1651992 Thu, 06 Sep 2018 00:57:25 +0000 http://css-tricks.com/?page_id=14222#comment-1651992 I am trying to put an endmark after the last paragraph inside the content in WordPress. Within the content I have a blockquote that WP automatically puts paragraphs inside. The p:last-child mark is being displayed inside the last paragraph of the blockquote instead of the last paragraph of the main content. Can’t figure out how to make it skip the paragraphs inside the blockquote.

]]>
By: miqureshi https://css-tricks.com/almanac/selectors/l/last-child/#comment-1605221 Sun, 27 Nov 2016 00:13:20 +0000 http://css-tricks.com/?page_id=14222#comment-1605221 Applying all anchor in ul instead last anchor

.loginNav li a:last-child { border-left:0;}

]]>
By: jorge https://css-tricks.com/almanac/selectors/l/last-child/#comment-1604937 Fri, 11 Nov 2016 00:37:26 +0000 http://css-tricks.com/?page_id=14222#comment-1604937 In reply to Geoff.

.home-middle-right > .entry:last-child

]]>
By: Uncle Jesse https://css-tricks.com/almanac/selectors/l/last-child/#comment-1599449 Thu, 04 Feb 2016 15:25:40 +0000 http://css-tricks.com/?page_id=14222#comment-1599449 In reply to Natalie.

@Eddy, quit creepin’, this isn’t FB.

]]>
By: 132413241324 https://css-tricks.com/almanac/selectors/l/last-child/#comment-1597166 Thu, 24 Sep 2015 10:20:22 +0000 http://css-tricks.com/?page_id=14222#comment-1597166 123412341234

]]>
By: Geoff https://css-tricks.com/almanac/selectors/l/last-child/#comment-1592469 Mon, 09 Feb 2015 04:15:16 +0000 http://css-tricks.com/?page_id=14222#comment-1592469 I’m having a problem in applying :last-child

Please see http://codepen.io/anon/pen/ZYaqgp

I want to remove the last bottom border in the widget area. Deactivating the second code block and activating the last – with the :last-child code – still removes all widget borders in that area.

Any suggestions please?

]]>
By: Robzor https://css-tricks.com/almanac/selectors/l/last-child/#comment-1592041 Wed, 21 Jan 2015 11:30:23 +0000 http://css-tricks.com/?page_id=14222#comment-1592041 In reply to Karl.

Can confirm also, works fine without the universal selector.

]]>
By: Nico https://css-tricks.com/almanac/selectors/l/last-child/#comment-1584779 Wed, 27 Aug 2014 19:50:08 +0000 http://css-tricks.com/?page_id=14222#comment-1584779 In reply to manirathinam.

You can use the nth-child() selector

your li:nth-child() {your style}

just put the number of the li, ex: nth-child(3)

]]>
By: manirathinam https://css-tricks.com/almanac/selectors/l/last-child/#comment-1584618 Fri, 22 Aug 2014 05:40:22 +0000 http://css-tricks.com/?page_id=14222#comment-1584618 I use more li. how can change particular li (ex 3rd li )

]]>
By: Eddy https://css-tricks.com/almanac/selectors/l/last-child/#comment-1584172 Sat, 02 Aug 2014 02:00:12 +0000 http://css-tricks.com/?page_id=14222#comment-1584172 In reply to Natalie.

Hi Natalie. U got a nice smile.
LOL

]]>