From the course: CSS: Selectors

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

Beginning, ending, and arbitrary substring attribute value selectors

Beginning, ending, and arbitrary substring attribute value selectors - CSS Tutorial

From the course: CSS: Selectors

Start my 1-month free trial

Beginning, ending, and arbitrary substring attribute value selectors

- [Instructor] Now that you know how to test for a full value in an attribute selector or individual words in that value, how might you test for a few letters as a value in an attribute selector? So, fortunately, we do have beginning, ending, and arbitrary substring attributes to help with that. Let's go on ahead and put 'em all in action right here. So, first of all, we have over here once again the same sort of unordered list. And what I'd like to do first is select all of the title attributes that start with the letters FI. And so the way we're going to go about doing that is, as always, square brackets and then the title and then the upper caret, the one above the number six, equals, and then FI. So we'll go ahead and make that color: red. So that's going to select both first and fifth, because both of those have the letters FI that start the value of that attribute selector. So that's the beginning substring attribute value selector. Next, let's go on ahead and look at the…

Contents