flat radio buttons with css?

Posted on 2004-11-04
Last Modified: 2013-11-19

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,
Question by:saimenCH
    1 Comment
    LVL 6

    Accepted 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

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    As a result of several questions about how to use Bootstrap I thought it would be a good idea to write down the development aspect of creating a Bootstrapped website in as little time as possible. Part 1 of this article will only concentrate on g…
    Introduction If you're like most people, you have occasionally made a typographical error when you're entering information into an online form.  And to your consternation, the browser remembers the error, and offers to autocomplete your future entr…
    In this tutorial viewers will learn how to style a decorative dropcap for the first letter in a paragraph using CSS. In CSS, create a new paragraph class by typing "p.fancy": Then, to style only the first letter of the first sentence, include the ps…
    The viewer will learn how to count occurrences of each item in an array.

    728 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

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now