What would be the best method to code heading/title for <ul> or <ol>, Like we have <caption> in <table>?

Jitendra Vyas picture Jitendra Vyas · Feb 9, 2010 · Viewed 108.6k times · Source

What would be the best method to code heading/title of <ul> or <ol>? Like we have <caption> in <table>, and we don't want to make them bold.

Is this okay?

<p>heading</p>
<ul>
  <li>list item</li>
  <li>list item</li>
  <li>list item</li>
</ul>

Or should headings always be used?

<h3|4|5|6>heading</h3|4|5|6>
<ul>
  <li>list item</li>
  <li>list item</li>
  <li>list item</li>
</ul>

Answer

Erasmus picture Erasmus · Dec 9, 2013

Though this is old, I'm updating it for others who might find this question when searching later.

@Matt Kelliher: