I have an html Ordered list with type set to "A"
<ol type="A">...</ol>
Thus, each list item will start with A, B, C, etc.
I would like to style the A, B, C letters to be bold. I have tried setting font-weight:bold; via css, but it didn't work. Any suggestions on how to do this?
As an alternative and superior solution, you could use a custom counter in a before element. It involves no extra HTML markup. A CSS reset should be used alongside it, or at least styling removed from the
ol
element (list-style-type: none, reset margin
), otherwise the element will have two counters.CSS:
An example: http://jsfiddle.net/xpAMU/1/
a bit of a cheat, but it works:
HTML:
CSS:
You could do something like this also:
So you have no "style" attributes in your HTML
You could do something like this also:
<ol type="A" style="font-weight: bold;">
It is simple code for the beginners.
This code is been tested in "Mozilla, chrome and edge..
I know this question is a little old, but it still comes up first in a lot of Google searches. I wanted to add in a solution that doesn't involve editing the style sheet (in my case, I didn't have access):
Are you sure you correctly applied the styles, or that there isn't another stylesheet interfering with your lists? I tried this:
Then in the stylesheet:
And it bolded the
A
,B
,C
etc and not the text.(Tested it in Opera 9.6, FF 3, Safari 3.2 and IE 7)