Snippets code from my daily experience

March 30, 2008

XUL and textbox CSS styles

Filed under: -moz-appearance,css,xul — dafi @ 12:46 pm

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😉

7 Comments

  1. Thank you! I was just wondering why the background-color wasn’t getting applied.

    Comment by Narc — April 5, 2008 @ 4:41 am

  2. :O! Work!!! Thxs!!!

    Comment by JackSparrow — May 13, 2008 @ 10:49 pm

  3. 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

  4. Thanks!

    Comment by Andrey — January 22, 2009 @ 11:40 am

  5. hey thank you very much, I was getting wired not getting css things work.. !!
    Thanks again🙂

    Comment by Mostanser Billah — May 25, 2009 @ 6:26 am

  6. Thank you google, and big thanks to you!!!!

    Comment by Magnus — June 9, 2009 @ 3:18 pm

  7. thanks dude, screw firefox

    Comment by dvh — June 20, 2009 @ 3:59 pm


RSS feed for comments on this post.

Blog at WordPress.com.

%d bloggers like this: