From the course: Crafting Meaningful HTML
Unlock this course with a free trial
Join today to access over 25,300 courses taught by industry experts.
Providing details with <details> and <summary> - HTML Tutorial
From the course: Crafting Meaningful HTML
Providing details with <details> and <summary>
- [Instructor] Next up, let's look at these frequently asked questions from the Two Trees Olive Oil Website. These could definitely be marked up a bit better than they are. We could use a definition list perhaps, to mark this up. The series of questions and answers and a definition list might be a good way of doing that. The question becomes our definition term while the answer would be the definition itself. But there is another structure we could use here though that would allow us to skim through the questions and give us a little interactivity in order to see the answer. This is the new details tag along with the summary tag. So let's start marking this up appropriately. And so the way this is going to work is as follows. What we're going to do is around the question and the answer, we are going to add a tag called details. And then after that answer we'll go on ahead and put in a slash details tag. And of course you can indent your HTML inside of that and then we're going to do…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.