From the course: CSS Shorts

Unlock this course with a free trial

Join today to access over 22,500 courses taught by industry experts.

Style by download type

Style by download type - CSS Tutorial

From the course: CSS Shorts

Style by download type

- [Chris] Hi, This is Chris Converse, and in this episode we'll style some hyperlinks based on what they're linking to. So if you'd like to follow along with me, download the exercise files and let's begin by opening the HTML file in a text editor. So once you have the HTML file open you'll see down in the body area we have an article element. And inside the article element we have a couple of other elements, an h1, a p tag, an unordered list. And inside of the unordered list, as individual list items, we have an anchor link that links to an annual report and a performance data file. And if you look at the href, the hypertext reference here, this one is linking to file.pdf, and this one's linking to file.xls. So what we're going to do is check in CSS to see what the ending characters are of the hyperlink and decide what the file type is so we can add custom styles. So to do that let's go back to the exercise files. Let's find style.css and let's open that in our text editor. So now in…

Contents