Search
Star
1.4k
Feedback
Setup for Free
KP-C
Kevin Powell - Community
•
4y ago
•
4 replies
iLoveCoffee
Clearfix Vs last-child
When I use clearfix
, it targets my after element rather than last child
. Is there any other clearfix solution so I can easily use
:last
-child as expected
?
.clearfix::after { content: ""; clear: both; display: table; }
.clearfix::after { content: ""; clear: both; display: table; }
Kevin Powell - Community
Join
A friendly place for developers to meet other devs, ask questions, get help, and just have a good time 🙂.
36,301
Members
View on Discord
Resources
ModelContextProtocol
ModelContextProtocol
MCP Server
Recent Announcements
Similar Threads
Was this page helpful?
Yes
No
© 2026 Hedgehog Software, LLC
Twitter
GitHub
Discord
System
Light
Dark
More
Communities
Docs
About
Terms
Privacy
.clearfix::after
{
content
:
""
;
clear
:
both
;
display
:
table
;
}
.clearfix::after
{
content
:
""
;
clear
:
both
;
display
:
table
;
}
Similar Threads
:last-child:first-letter:hover
KP-C
Kevin Powell - Community / front-end
2y ago
:last-child and :not pseudo classes together
KP-C
Kevin Powell - Community / front-end
3y ago
:nth-child(odd), :nth-child(even)
KP-C
Kevin Powell - Community / front-end
16mo ago