Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

CSS CSS Layout Techniques Float Layout The Float Clearfix

Edward Bryan Kene Morales
Edward Bryan Kene Morales
7,374 Points

What the difference between .group:after and .group::after

So I am just curious why Guil is using .group::after in the video. This css is used in the video to clear the floats.

I am just curious because HTML5 Boilerplate uses .clearfix:after, please note that one ":" is only used.

Can somebody please shed me some light on this? Thanks! Will really appreciate it.

1 Answer

The ::after notation was introduced in CSS 3 in order to establish a discrimination between pseudo-classes and pseudo-elements. Browsers also accept the notation :after introduced in CSS 2. Before and After are pseudo-elements whereas something like :nth-of-type is a pseudo-class. Hope that helps!

Edward Bryan Kene Morales
Edward Bryan Kene Morales
7,374 Points

Thanks Parker! Now it's clear for me :) Cheers!