Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
- :nth-child 8:00
- :nth-of-type 4:30
- :nth Pseudo-Class Challenge 2 objectives
- :nth Pseudo-Class Challenge - Pt. 2 1 objective
- :root and :target 5:12
- :not() – The Negation Pseudo-Class 4:46
- Pseudo-Elements - ::first-line and ::first-letter 5:00
- Pseudo-Elements - ::before and ::after 8:13
- The attr() CSS Function 6:32
- Pseudo-Elements Challenge 4 objectives
- Advanced Selectors Review 6 questions

- 2x 2x
- 1.75x 1.75x
- 1.5x 1.5x
- 1.25x 1.25x
- 1.1x 1.1x
- 1x 1x
- 0.75x 0.75x
- 0.5x 0.5x
The ::before and ::after pseudo-elements let us insert virtual elements before and after an element’s content. These virtual elements are visible to the user and are styleable with CSS, but they do not appear in the source code.
Quick Reference
What we need to know about pseudo-elements
- The only way we're able to generate pseudo-elements is with the
content
property. -
Pseudo-elements do not work with images and form elements. Replaced elements like
input
orimg
have no content, so we shouldn't be able to use generated content for them (source).
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up-
Ubo Town
3,227 Points2 Answers
-
Kirt Perez
7,374 Points1 Answer
-
Rouillie Wilkerson
10,419 Points1 Answer
-
Aakash Srivastav
Full Stack JavaScript Techdegree Student 11,638 Points2 Answers
-
Saqib Ishfaq
13,912 PointsPseudo-elements do not work with images and form elements. ???
Posted by Saqib IshfaqSaqib Ishfaq
13,912 Points1 Answer
-
pat barosy
6,759 Points2 Answers
-
Alex Wylie
4,364 PointsPseudo-Elements - ::before and ::after Why do the icons stay as links?
Posted by Alex WylieAlex Wylie
4,364 Points2 Answers
-
Peter Tomasiewicz
5,592 Points1 Answer
-
Andrew Geisler
7,246 Points2 Answers
-
Diego Murray
2,515 Points2 Answers
-
gregsmith5
32,615 Points2 Answers
-
Santiago Enciso
17,789 Points5 Answers
-
AR Ehsan
7,912 Points2 Answers
-
Geoffrey Neal
30,298 Points2 Answers
-
Harvey Ball
8,546 Points3 Answers
View all discussions for this video
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up