Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Oct 2009
    Thanked 3 Times in 3 Posts

    How to change background color of radio button using CSS ?

    I have been looking around but so far no one has found a way to change the background of a radio button or the button border from the posts I found.

    Can anyone suggest how this might be done ?

  2. #2
    Administrator VIPStephan's Avatar
    Join Date
    Jan 2006
    Halle (Saale), Germany
    Thanked 1,313 Times in 1,283 Posts
    It’s not possible. Form controls, and especially radio buttons, checkboxes, and file inputs, are kind of special in that they have limited styling possibilities. Often their look even relies on the operating system in which the browser is used.

    There is an article that is pretty old but still kind of valid, and it shows how different radio buttons (and other form controls) look in different browsers or operating systems. So, even if you were able to change the color in your browser, it doesn’t mean that everyone else is seeing the same.

    That said, the only way to (kind of) reliably customize the look of form controls cross-browser is to replace them with regular elements and using JS to restore the expected functionality. One popular script for this is Niceforms.

  3. #3
    Master Coder sunfighter's Avatar
    Join Date
    Jan 2011
    Thanked 1,012 Times in 1,009 Posts
    Don't think OP is talking about doing this in a form and not sure if these articles will help but look at:
    How to style Radio Buttons in pure CSS — Andrea PinchiAnd
    This How To Change Radio Button Checkbox Style in CSS
    Evolution - The non-random survival of random variants.
    Physics is actually atoms trying to understand themselves.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts