So, I'm marking up client web design. The page is a frequently asked questions page in which each section of frequently asked questions contains a list of questions and answers. The most appropriate semantic markup for this scenario is the html definition list.
The client’s layout also shows the numbers next to each pair of questions / answers, for example, an ordered list.
So, naturally, I thought that just mark the content with an element <dl>and add it using CSS list-style-type: decimal. However, this is completely ignored.
Is it because the item <dl>cannot accept the list style? This seems terribly inverse, since it is, after all, a list item!
Or am I doing something wrong with my markup?
Here is an example of my CSS and HTML code:
dl { list-style: decimal; }
<dl class="some-list">
<dt><strong>Q</strong>: How Do I Do Some Thing?</dt>
<dd><p><strong>A:</strong> You just do it, okay? Want a longer explanation? Try this: You just do it, okay? Want a longer explanation? Try this: You just do it, okay? Want a longer explanation? Try this: You just do it, okay? Want a longer explanation? Try this:</p>
</dd>
<dt><strong>Q</strong>: How Do I Do Some Other Thing?</dt>
<dd><p><strong>A:</strong> You just do it, okay? Want a longer explanation? Try this: You just do it, okay? Want a longer explanation? Try this: You just do it, okay? Want a longer explanation? Try this: You just do it, okay? Want a longer explanation? Try this:</p>
</dd>
</dl>
Run codeHide result
source
share