Closed
Bug 163376
Opened 23 years ago
Closed 21 years ago
::first-letter initial caps poorly adjusted to flow
Categories
(Core :: Layout, defect, P4)
Core
Layout
Tracking
()
Future
People
(Reporter: nikd, Unassigned)
Details
(Keywords: css3, testcase)
Attachments
(3 files)
When making initial caps in CSS, one shouldn't have to adjust margins to make
the initial cap fit nicely in the flow.
With the definition
p.cap:first-letter {
float: left;
position: relative;
font-weight: 700;
font-size: 400%
}
one expects an intial cap that is rendered with respect to the font metrics
defined for the selected font. In reality, it seems that metrics for the
Helvetica or Times fonts are used whatever font is selected (as these look the
least distorted).
Adding
margin: -0.1em 0.1em -0.2em 0em;
to the definition somewhat relieves the problem for most fonts, but it shouldn't
be necessary, and it also complicates matters (IE renders things differently, of
course).
The test case at http://homepage.mac.com/nikd/caps/ has ten different style
sheets with ten different fonts. Use the "Use Style" list in the View menu to
see how various fonts are rendered with or without adjusted margins.
It may not be possible to implement the perfect initial cap algorithm within the
CSS scope, but the initial cap should have ample room to the text on the right
(there is overlap using Georgia and American Typewriter, and in general it is
too close). The initial cap should also not be pushed down too much.
Reporter | ||
Comment 1•23 years ago
|
||
Red = unadjusted, blue = adjusted
Reporter | ||
Comment 2•23 years ago
|
||
Another example. Note the overlap.
CSS3 (text module?) might have some things that will allow this to be better.
Assignee: dbaron → attinasi
Status: UNCONFIRMED → NEW
Component: Style System → Layout
Ever confirmed: true
Keywords: css3
OS: MacOS X → All
QA Contact: ian → petersen
Hardware: Macintosh → All
Updated•23 years ago
|
QA Contact: petersen → amar
Updated•23 years ago
|
Priority: -- → P4
Updated•23 years ago
|
Target Milestone: --- → Future
Comment 4•23 years ago
|
||
If you set different background colors, it looks like gratuitous top and bottom
padding is added to the initial letter. Explicitly setting the padding to zero
has no effect. (Explicitly setting the line-height also has no effect, but this
may be correct behavior for a floated letter--the spec isn't quite clear on
this point.)
![]() |
||
Comment 5•22 years ago
|
||
.
Assignee: attinasi → other
Priority: P4 → --
QA Contact: amar → ian
Target Milestone: Future → ---
Updated•22 years ago
|
Priority: -- → P4
Target Milestone: --- → Future
Updated•22 years ago
|
Keywords: testcase
Summary: :first-letter initial caps poorly adjusted to flow → ::first-letter initial caps poorly adjusted to flow
Comment 6•21 years ago
|
||
*** This bug has been marked as a duplicate of 21616 ***
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → DUPLICATE
You need to log in
before you can comment on or make changes to this bug.
Description
•