Is there a way to create a list-style in HTML with a dash (i.e. - or – –
or — —
) i.e.
<ul>
<li>abc</li>
</ul>
Outputting:
- abc
It's occurred to me to do this with something like li:before { content: "-" };
, though I don't know the cons of that option (and would be much obliged for feedback).
More generically, I wouldn't mind knowing how to use generic characters for list items.
There is an easy fix (text-indent) to keep the indented list effect with the
:before
pseudo class.Here is my fiddle version:
The (modernizr) class
.generatedcontent
on<html>
practically means IE8+ and every other sane browser.CSS:
Another way:
Let me add my version too, mostly for me to find my own preferred solution again:
https://codepen.io/burningTyger/pen/dNzgrQ
In my case adding this code to CSS
was enough. Simple as it is.