RoiEX RoiEX - 1 year ago 56
HTML Question

Is style="display: list-item" using <a> tag inside <ol> legal?

I just discovered the

display: list-item;
option in CSS, but I'm not sure on how to use it correctly. It works fine for me in Firefox using:

<a href="target.php" style="display:list-item;">TargetLink</a>

But Eclipse tells me that it is not supposed to be used like this (warning: invalid location of tag a)

I tried without
or with a
tag with
style="list-style-type: decimal;"
instead, but this way every entry is the

is style="display: list-item;"
supposed to be used?


I think you can use display: list-item like this, also only li can be direct children of ul and ol

.item {
  list-style-type: square;
  list-style-position: inside;
<p class="item">Lorem ipsum dolor.</p>
<p class="item">Lorem ipsum dolor.</p>
<div class="random">Lorem ipsum dolor.</div>
<div class="item">Lorem ipsum dolor.</div>