Closed
Bug 221770
Opened 21 years ago
Closed 20 years ago
ol li:first-letter { font-weight: bold; } has no effect
Categories
(Core :: CSS Parsing and Computation, defect)
Tracking
()
RESOLVED
INVALID
People
(Reporter: M.Hoffmann, Assigned: dbaron)
Details
(Keywords: qawanted, testcase)
Attachments
(1 file, 1 obsolete file)
653 bytes,
text/html
|
Details |
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•21 years ago
|
||
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.
Assignee | ||
Comment 2•21 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•21 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.
Comment 4•21 years ago
|
||
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•21 years ago
|
||
new testcase reflecting the two options in Hixie's comment.
Attachment #132986 -
Attachment is obsolete: true
Comment 6•21 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. :)
Status: UNCONFIRMED → NEW
Ever confirmed: true
Comment 7•21 years ago
|
||
Hmm, since UAs seem to agree on this, maybe I should change the spec.
Comment 8•21 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 http://www.xanga.com/home.aspx?user=squarebox <font size="6" style="font-weight: bold;">あけまして おめでとう!<br> <br> </font>
Comment 10•20 years ago
|
||
(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
Comment 11•20 years ago
|
||
Mats, I'd send mail to www-style about spec changes...
Comment 12•20 years ago
|
||
CSS2.1 defines this case, by the way. (Or mentions it. I forget if it technically actually _defines_ it per se.)
Comment 13•20 years ago
|
||
It turns out CSS 2.1 is already clear on the matter: http://www.w3.org/TR/CSS21/selector.html#first-letter 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: http://www.w3.org/TR/2002/WD-css3-linebox-20020515/ http://www.w3.org/TR/2002/WD-css3-lists-20021107/ but could not find this case mentioned. -> INVALID
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → INVALID
Comment 14•20 years ago
|
||
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.
Description
•