Closed Bug 26089 Opened 26 years ago Closed 26 years ago

Padding on elements not showing proper background color

Categories

(Core :: CSS Parsing and Computation, defect, P3)

x86
Windows NT
defect

Tracking

()

VERIFIED WORKSFORME

People

(Reporter: Scott.Springer, Assigned: pierre)

Details

Attachments

(1 file)

According to CSS specifications, elements whose content has been adjusted by the "padding" attribute should have the padding space render in the background color of the element that the attribute is assigned, not the parent element. For example: <head> <style type="text/css"> .class1 {background-color: #FFFFFF;} .class2 {margin: 0; border: 0; padding: 2pc; background-color: #FF0000;} .class3 {margin: 0; border: 0; padding: 2pc; background-color: #0000FF;} </style> </head> <body> <div class="class1"> <div class="class2">Text in DIV class 2</div> <div class="class3">Text in DIV class 3</div> </div> </body> This should render as follows: ----------------------------------------------------------- | ( Red Background ) | | Text in DIV class 2 | | | ----------------------------------------------------------- | ( Blue Background ) | | Text in DIV class 3 | | | ----------------------------------------------------------- However, currently this is what is happening: ----------------------------------------------------------- | ( White Background ) | | -------------------------------------------------- | | |Text in DIV class 2 (Red Background) | | | -------------------------------------------------- | | | ----------------------------------------------------------- | ( White Background ) | | -------------------------------------------------- | | |Text in DIV class 3 (Blue Background) | | | -------------------------------------------------- | | | ----------------------------------------------------------- This is pretty important in terms of CSS, and it should be fixed as soon as possible.
Created an attachment using the code supplied below. Using 2/1 build, WORKSFORME.
Works for me all right too.
Status: NEW → RESOLVED
Closed: 26 years ago
Resolution: --- → WORKSFORME
Verified WORKSFORME.
Status: RESOLVED → VERIFIED
Okay, now it is working for me on simple examples. However, the case that I dealt with was a little more complex. The styles were being applied to TD elements of a table, and I'm wondering whether or not the fact that a table (in fact, many tables) was involved caused the problem. There could also be another style that I applied to the page some time ago that I forgot about that could be causing the problem. I'll have to look for it. As of now, though, I guess I was wrong on this one.
Scott: if you can reproduce the problem by using a similar code inside tables, be aware that we have known bugs related to syle within tables (bug 915 and bug 1044).
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: