Go Premium for a chance to win a PS4. Enter to Win


Radio button style

Posted on 2010-11-16
Medium Priority
Last Modified: 2012-05-10
Hello All,

I am trying to figure out if there is any way I can change the default green circle of the radio button with purple color?

Please can someone advise?

Question by:charlie324
  • 3
  • 2
  • 2

Expert Comment

ID: 34143129

if you are using a Windows PC with default desktop / color settings, the default radiobutton color is a blue dot, not green.

But nevertheless, the radiobutton can't be styled in CSS as such. You will need to use a combination of CSS and JavaScript to customize your radiobuttons.

Please let me know if that's the case or if I have misunderstood your question.

- Mestika

Author Comment

ID: 34143158
Hi Mestika
Thanks for your input, yes I am on Windows PC using FF, please see the screen shot attached, its showing in green color.
Yes, I want to apply #554061to the inner circle of the radio button, please can you advice how can I go about doing this?
Your help/suggestion/advise would greatly be appreciated.
Thank you

Expert Comment

ID: 34143216
Of yes of cause I forgot that Windows XP with FF showed them in green :-)

About your radiobuttons, you will have to create an image for a radiobutton active and one for a radiobutton inactive.

I could explaine the entire code with CSS and JS to you but I think that you would be more comfortable with some tutorials, so please look at these two pages:


They both explain the styling of the radio / checkboxes and the first page shows how you can do it with only one image containing both an active and inactive radiobutton where the other page has a image for each type of radiobutton.

If you only want to keep the original style but change the color, it should be a fairly easy task just to Photoshop and colorize the green color into purple.

Please let me know if you have any further questions

- Mestika
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Author Comment

ID: 34147945
Hi Mestika
I did try to follow from the links above but did not have no luck on this yet ... please can you help in making one?
thank you

Expert Comment

ID: 34148468
Call me silly, but couldn't you just create two images... One for selected and one for unselected and use javascript to change them? You could even use a third image for highlighting the radio button on mouseover. It would be much more customizable this way.

Accepted Solution

Mestika earned 800 total points
ID: 34148999
Hey Charlie,

You have to create two images which is called: radio-off.png and radio-on.png

just put them in the same directory as the HTML file. Every CSS and JavaScript is within the HTML so the only thing you have to do is the two images.

I've created an zip archive with the index.htm and the two images so you can test it. Get it here:


Assisted Solution

TheQuietShadow earned 200 total points
ID: 34149030
I am including a sample that I know works in FireFox, but I don't know if it works in IE. You may have to tweek it to work in IE and will probably want to create your own images.

<title>Your first selection&nbsp; Your secon</title>
<script type="text/javascript">
var radio = 0;
function click(id) {
      if (id == "rb0")
            document.getElementById("rb0").setAttribute("src", "Radio%20Button/on.png");
            radio = 0;
            document.getElementById("rb1").setAttribute("src", "Radio%20Button/off.png");
            document.getElementById("rb1").setAttribute("src", "Radio%20Button/on.png");
            radio = 1;
            document.getElementById("rb0").setAttribute("src", "Radio%20Button/off.png");

<span onclick="click('rb0');" style="cursor:pointer"><img id="rb0" src="Radio%20Button/off.png" alt="" height="22px" width="22px" style="position:relative;top:4px;" />
Your first selection</span>
<br />
<span onclick="click('rb1');" style="cursor:pointer"><img id="rb1" src="Radio%20Button/on.png" alt="" height="22px" width="22px" style="position:relative;top:4px;" onclick="click('rb1');" />
Your second selection</span>
 on off

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Originally, this post was published on Monitis Blog, you can check it here . Websites are getting bigger and more complicated by the day. Video, images and custom fonts are all great for showcasing your product or service. But the price to pay in…
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

876 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question