From the course: Creating a Responsive Web Design

Unlock this course with a free trial

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

Adding indication arrows

Adding indication arrows - CSS Tutorial

From the course: Creating a Responsive Web Design

Adding indication arrows

- The final thing I'd like to do to the navigation is indicate to the user whether or not each one of these items has a sub menu. Now unfortunately, in CSS, we have no way to target a parent, only if is has a particular child. We can do some of this with JavaScript or other techniques but we can't do it simply with CSS. So are choices are, we can manually add a class to each one of the parent elements, or since we have added our ARIA tags, I want to lock onto those ARIA tags, since we already defined in the HTML which items have sub menus. So let's go back to our CSS file, and let's go down below our top level items and what we're gonna do here is create a CSS role that's going to target elements that have a specific attribute. So we'll type nav, space, then an anchor tag, then we're gonna put in two square brackets. Inside of the brackets we can type an attribute name and then check for a specific value. So we'll type ARIA dash haspopup, then an equal sign, then we're gonna put two…

Contents