i was wondering if it’s like a good practice insert headings into lists?
it’s for the main nav that i was thinking like:
<ul>
<li><h3><a>home</blabla…>
is this correct?
or should i stick with regular text?
i was wondering if it’s like a good practice insert headings into lists?
it’s for the main nav that i was thinking like:
<ul>
<li><h3><a>home</blabla…>
is this correct?
or should i stick with regular text?
It depends upon context but usually the heading appears outside of the UL itself as a ‘heading’ for the list not an item of the list.
<li> is an inline element, where headings are block elements. Placing block elements inside inline elements isn’t something to do casually.
I suspect you’re trying to get your text in the <li> item to appear a particular way. Just style it:
.selectedtext {
color: #fff;
}
<ul>
<li class="selectedtext">text</li>
</ul>
It’s OK to have block level elements inside a LI (as it’s basically a block element itself), but make sure there’s a real reason for it. An example would be a list of advertisements where each list item has a heading, text, images and so on (commonly seen in sliding galleries).