If you want to change the background color for HTML input text boxes you simply set the background-color style attribute, very obvious.
.my-textbox {
background-color: red;
}
If you want to make same thing for XUL textboxes you apply the same style attribute discovering it doesn’t work…
Ehm.. It works but you must disable standard mozilla behaviour using -moz-appearance attribute
.my-textbox {
-moz-appearance: none;
background-color: red;
}
Little lesson learned ![]()


Thank you! I was just wondering why the background-color wasn’t getting applied.
Comment by Narc — April 5, 2008 @ 4:41 am
:O! Work!!! Thxs!!!
Comment by JackSparrow — May 13, 2008 @ 10:49 pm
Thanks for sharing this tip. They really should emphasize this in a more obvious way on the Mozilla wiki. Maybe, I’ll edit it.
Comment by abi — June 14, 2008 @ 7:06 pm