[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 969
  • Last Modified:

flat radio buttons with css?


I would like to have radio buttons with flat borders with css technology.
With textfields, I can do this with border:1px solid [#color]. But it seems that this doesn't work for radio buttons. I also searched with google but didn't find anything...

Does someone know how to make flat radio buttons with css?

thank you,
1 Solution
AFAIK it can't be done with css only.

An option would be to use 2 images and a bunch of javascript. The 2 images of course representing a checked and unchecked flat radiobutton.
You would get something like this:
      function toggleRadioBtn(e) {
            if (e.src == "") {
                  e.src = "";
                  document.forms[0].radioBtn1.value = 1;
            } else {
                  e.src = "";
                  document.forms[0].radioBtn1.value = 0;
      <img src="/assets/img/radioButtonUnchecked.gif" onclick="toggleRadioBtn(this);">
      <input type="hidden" name="radioBtn1" value="0"/>

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now