Closed Bug 10218 Opened 26 years ago Closed 26 years ago

Stylesheet width problem.

Categories

(Core :: Layout, defect, P3)

x86
Linux
defect

Tracking

()

VERIFIED INVALID

People

(Reporter: rnicoll, Assigned: troy)

References

()

Details

I'm using M8, and hit a problem when testing my own pages. Look at the URL I've included; the HTML code at the bottom comes out okay, but the grey background is too wide. Basically, the stylesheet for that part is: width: 100%; border: none; margin-left: 3em; background: #CCCCCC; font-family: Courier, monospace; It seems the width calculations aren't adjusted to take account of the left margin, meaning the grey background goes off the right edge of the screen.
Assignee: peterl → troy
Component: Style System → Layout
Status: NEW → RESOLVED
Closed: 26 years ago
Resolution: --- → INVALID
That's the way it's supposed to work (10.3.3 of CSS2 spec). You explicitly set the 'width' to 100% and hence it overflows its containing block and is visible It seems that what you really want is to use 'auto' for the 'width' instead. Like this: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <base href="http://wired.dcs.st-and.ac.uk/~rnicoll/ecommerce/"> <HEAD> <style> P.code { width: auto; border: none; margin-left: 3em; margin-right: auto; background: #CCCCCC; font-family: Courier, monospace; } </style> </HEAD> <BODY> <P CLASS="code">&lt;!-- #insert $VARIABLE_NAME --&gt;</P> </BODY> </HTML>
Status: RESOLVED → VERIFIED
*** Bug 126145 has been marked as a duplicate of this bug. ***
You need to log in before you can comment on or make changes to this bug.