Time for action – making it fancy
Perform the following steps to add some fancy new features to the FAQ page:
- Let's start with a little CSS code to change the cursor to a pointer and add a little hover effect to our questions to make it obvious to site visitors that the questions are clickable. Open up the
styles.css
file that's inside thestyles
folder and add the following bit of CSS code:.jsOn dt { cursor: pointer; } .jsOn dt:hover { color: #ac92ec; }
We're only applying these styles for those site visitors that have JavaScript enabled. These styles definitely help to communicate to the site visitor that the questions are clickable. You might also choose to change something other than the font color for the hover effect. Feel free to style your FAQ list however you'd like. Have a look at the following screenshot:
- Now that we've made it clear that our
<dt>
elements can be interacted with, let's take a look at how to show the answers in a nicer...