ol li:first-letter { font-weight: bold; } has no effect




CSS Parsing and Computation
15 years ago
13 years ago


(Reporter: Matthias Hoffmann, Assigned: dbaron)


({qawanted, testcase})

Windows 2000
qawanted, testcase

Firefox Tracking Flags

(Not tracked)



(1 attachment, 1 obsolete attachment)

653 bytes, text/html


15 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.0; de-AT; rv:1.4) Gecko/20030624
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; de-AT; rv:1.4) Gecko/20030624

ol li:first-letter { font-weight: bold; } in an external stylesheet does not
work as expected with ordered lists; I've tried this to emphasize the numbers 1.
2. etc. at the start of each <ol><li>entry</li>...</ol>. With IE 6, they appear
in bold type, as expected.

Reproducible: Always

Steps to Reproduce:
1. Create a html-page with a simple ordered-List and the above mentioned styledef
2. load this page into the browser

Actual Results:  
The numbers in front of the list items are NOT boldfaced!

Expected Results:  
The numbers should be formatted according the style-spec

I know no other way to format a numbered list, so that the numbers in front of
the list items are boldfaced, for example. So I have to use CSS, which not works
as expected...

Comment 1

15 years ago
Created attachment 132986 [details]

This looks like correct behavior.  The list-item marker is not the first
letter.  Whatever the first letter of the content of the <li> tag is
constitutes the first letter, and is being bolded by Mozilla.

Opera 7 also renders as Mozilla.


15 years ago
Keywords: testcase

Comment 2

15 years ago
Ian, what does (or should) css3-lists/css3-content say about this?  I think per
CSS2 our behavior is actually incorrect.

Comment 3

15 years ago
Just to document then, if this is a bug, IE6 bolds both the list-item marker and
the first letter of the actual <li> content.
CSS3 says that the :first-letter will match the first letter of the list item if 
the list item is 'list-style-position:inside', and not if the list item is 
'list-style-position:outside'. Basically, 'inside' makes '::marker' work 
something like an inline '::before', but 'outside' makes it work like an 
out-of-flow box that just happens to take part in the inline box model.

Comment 5

15 years ago
Created attachment 132998 [details]

new testcase reflecting the two options in Hixie's comment.
Attachment #132986 - Attachment is obsolete: true

Comment 6

15 years ago
Confirming new since one of the exhibited testcase behaviors must be a bug then,
since they render the same where :first-letter is concerned.

Just not sure I understand yet which one is the bugged behavior, or I would
resummarize this bug.  :)
Ever confirmed: true
Hmm, since UAs seem to agree on this, maybe I should change the spec.

Comment 8

14 years ago
a similar bug with bolded font weight not rendering correctly exists in firebird
0.7 on winxp as well.  Following code does not render text in bold.  Renders in
IE 6.0 correctly.  The following code was snipped from jan 2nd entry of

<font size="6" style="font-weight:

Comment 9

14 years ago
comment 8 is not related to this bug
(In reply to comment #7)
> Hmm, since UAs seem to agree on this, maybe I should change the spec.

Seems like a good idea.  If/when CSS3 introduces ::marker it gives greater
freedom to style ::marker/::first-letter independently if the current UA
behaviour is kept as is.
Keywords: qawanted
Mats, I'd send mail to www-style about spec changes...
CSS2.1 defines this case, by the way. (Or mentions it. I forget if it
technically actually _defines_ it per se.)
It turns out CSS 2.1 is already clear on the matter:

  If an element is a list item ('display: list-item'), the ':first-letter'
  applies to the first letter in the principal box after the marker.
  UAs may ignore ':first-letter' on list items with
  'list-style-position: inside'.

Note the "after the marker", which makes this bug invalid.

To my surprise CSS3 is less clear, I checked both the Line and List modules:
but could not find this case mentioned.

Last Resolved: 13 years ago
Resolution: --- → INVALID
Both of those drafts are older than the CSS2.1 spec.
You need to log in before you can comment on or make changes to this bug.