Closed Bug 222482 Opened 21 years ago Closed 21 years ago

CSS - Padding applied to form fields of type="hidden" creates visible "lines" when display is set to "block".

Categories

(Core :: Layout: Form Controls, defect)

x86
Windows XP
defect
Not set
minor

Tracking

()

VERIFIED INVALID

People

(Reporter: apawson, Unassigned)

References

Details

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.5a) Gecko/20030728 Mozilla Firebird/0.6.1
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.5a) Gecko/20030728 Mozilla Firebird/0.6.1

A CSS rule such as this one:

input {
padding: 2px;
display: block;
background-color: red;
}

will cause form fields of type="hidden" to display the padding. The
'background-color' value is irrelevant - but makes it easier to see the effect
if you're testing this on a page with a white background. It seems to be the
combination of the 'padding' and the 'display' attributes, since removing one or
the other seems to 'fix' the problem.

Reproducible: Always

Steps to Reproduce:
1. Create a form field of type="hidden".
2. Add the following styles to the element (inline or via <style> or external
stylesheet): display: block, padding: SOMEVALUEGREATERTHANZERO;
3. Be sure to set the page background color to some color other than white.



Expected Results:  
An <input> element whose type is set to "hidden" should not affect the visual
rendering of the page regardless of any styles that are applied to it.
"An <input> element whose type is set to "hidden" should not affect the visual
rendering of the page regardless of any styles that are applied to it."

Why?  You're asking for display:block, that's what you're getting.

Add an input[type=hidden] { display : none;} rule of some sort, or write your
CSS so that it's not all inclusive of every input element.

->Layout/Form
Assignee: blake → form
Component: General → Layout: Form Controls
Product: Firebird → Browser
QA Contact: ian
Version: unspecified → Trunk
This is working as-designed.  type="hidden" on input elements triggers a rule in
the UA sheet that sets them to display:none.  But the code in question
explicitly overrides this rule.
Status: UNCONFIRMED → RESOLVED
Closed: 21 years ago
Resolution: --- → INVALID
v
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.