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
We're also able to write simple CSS functions to generate content. In this video, we'll see how the attr() function inserts an element's attribute value as page content. Before we wrap up, we'll do a quick review of the advanced selectors we just learned.
Quick Reference
Using attr()
This pseudo-element rule will insert the value of an a
element's title
attribute after the link's content:
a::after {
content: attr(title);
}
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up-
Joshua Graber
11,785 Points2 Answers
-
JOE BELL
11,113 Points1 Answer
-
Zachary Danz
Front End Web Development Techdegree Graduate 15,024 Points1 Answer
-
Terrence Wells
14,609 Points1 Answer
-
Li Mbo
5,096 PointsIn real life, does a web developer remember all those selectors?
Posted by Li MboLi Mbo
5,096 Points5 Answers
-
Kasper Peulen
921 Points2 Answers
-
jocelyn alsdorf
22,454 Points2 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