Closed
Bug 127678
Opened 22 years ago
Closed 22 years ago
text-align:center does not render correctly
Categories
(Core :: CSS Parsing and Computation, defect)
Tracking
()
VERIFIED
INVALID
People
(Reporter: donb, Assigned: asa)
Details
Attachments
(1 file)
471 bytes,
text/html
|
Details |
In this sample HTML, "First Link" is not center justified. Text should render in center of defined 680px wide box. Width seems to be ignored - "Next Link" appears immediately after first link. <HTML> <BODY> <a href="#" style="width:680px;text-align:center"> First Link </a> <a href="#">Next Link</a> </BODY> </HTML>
Comment 1•22 years ago
|
||
I think that the real point of this bug report is that Don wants the "first link" to have the width of 680px's? If so, I can't remember if inline elements should honor width or height. Sending over to style system. I made a new testcase that has an image included just to show mozilla does honor width and height for styling images.
Comment 2•22 years ago
|
||
Don, if your problem with mozilla is that you want to set the width to the anchor, I would suggest that you change the "Summary" title to can't set width for anchor... Again my revised testcase shows that mozilla does not render either width or height for anchors but does for images. Also, my testcase shows that IE6 renders just like mozilla 2-24 build for WinXP.
Component: Browser-General → Style System
Comment 3•22 years ago
|
||
This is invalid. the link is an inline element, so you can't set its width. You can do it if you add this rule to its style: display:block;
Status: UNCONFIRMED → RESOLVED
Closed: 22 years ago
Resolution: --- → INVALID
Comment 4•22 years ago
|
||
Midair ->verify. See http://www.w3.org/TR/REC-CSS2/text.html#propdef-text-align
Status: RESOLVED → VERIFIED
Comment 5•22 years ago
|
||
I think that this may be a better explaination why you can't set width for inline elements instead of text-align... from wc site (http://www.w3.org/TR/REC-CSS2/visudet.html#propdef-width): This property does not apply to non-replaced inline-level elements. The width of a non-replaced inline element's boxes is that of the rendered content within them (before any relative offset of children). Alfonso is right you need to set the anchor to block to set its width and center the text. :-)
You need to log in
before you can comment on or make changes to this bug.
Description
•