From the course: Crafting Meaningful HTML

Unlock the full course today

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

Providing details with <details> and <summary>

Providing details with <details> and <summary> - HTML Tutorial

From the course: Crafting Meaningful HTML

Start my 1-month free trial

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…

Contents