Intermediate HTML & CSS

Attribute Selectors Exercise

Jen Kramer

Jen Kramer

AnnieCannons
Intermediate HTML & CSS

Check out a free preview of the full Intermediate HTML & CSS course

The "Attribute Selectors Exercise" Lesson is part of the full, Intermediate HTML & CSS course featured in this preview video. Here's what you'd learn in this lesson:

Students are instructed to style any link to a PDF file by adding the string "(PDF)" to the end of the link's text.

Preview
Close

Transcript from the "Attribute Selectors Exercise" Lesson

[00:00:00]
>> So you're ready for one of my all time favorite tricks. This is where this comes in super handy so again let's say that you live in the world of content management systems. That's my deep background I come from in Joomla, originally I do work with WordPress and so forth.

[00:00:15]
So, one of the things that happens is your styling and maybe for accessibility purposes, you need to flag every time somebody links to a PDF. Now exactly how likely it is that your client is typing away. They're in their little editing window. That they're gonna stick a parenthesis PDF after every link that has a PDF on it, right.

[00:00:37]
Yeah, zero it's just never gonna happen. Wouldn't it be great if we could program that? We can, using the arbitrary selectors. So, with that hint in mind, how about I give you like three minutes. Think about how could you, so using the attribute selectors, I don't tell you which one, you can pick select all links to PDFs.

[00:01:16]
On the page and put a PDF in parentheses after it. Okay, take three minutes and see if you can write the selector.

Learn Straight from the Experts Who Shape the Modern Web

  • In-depth Courses
  • Industry Leading Experts
  • Learning Paths
  • Live Interactive Workshops
Get Unlimited Access Now