Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Possible to change appearance of radio button with css?

Reply
Thread Tools

Possible to change appearance of radio button with css?

 
 
Brian Cryer
Guest
Posts: n/a
 
      03-26-2007
I think the answer to this is no, but it wouldn't be the first time I was
wrong, so ...

Question: Is it possible to change the appearance of a radio button using
css? What I'm actually after is the ability to change the button to look
like a tick-box, so changing the image used.

This came up when a colleague was talking to me about a small project. His
requirement is for the functionality of radio buttons but the appearance of
tick-boxes. I know this could be done using some JavaScript, what I was
wondering was whether there was a solution that didn't rely on client side
scripting.

Thanks.
--
Brian Cryer
www.cryer.co.uk/brian



 
Reply With Quote
 
 
 
 
Jukka K. Korpela
Guest
Posts: n/a
 
      03-26-2007
Scripsit Brian Cryer:

> Question: Is it possible to change the appearance of a radio button
> using css?


Absolutely maybe. It depends. You might be able to change their size, for
example, by setting the width and height properties. You cannot change most
aspects of rendering of radio buttons, though, thank &Deity;.

> His requirement is for the functionality of radio buttons
> but the appearance of tick-boxes.


That means intentionally misleading people. Interesting functionality.

> I know this could be done using
> some JavaScript, what I was wondering was whether there was a
> solution that didn't rely on client side scripting.


You could do this by using a <noscript> element containing normal radio
buttons (so the page would actually _work_ when JavaScript is disabled) and
some JavaScript code that adds a set of images into the document tree and
associates onclick handlers with them, so that when clicked on, the image
changes and the form data is changed too.

Of course, the approach would break the normal functionality of radio
buttons in keyboard-only use, among other things.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

 
Reply With Quote
 
 
 
 
Andy Dingley
Guest
Posts: n/a
 
      03-26-2007
On 26 Mar, 12:16, "Brian Cryer" <brian.cr...@127.0.0.1.ntlworld.com>
wrote:

> Question: Is it possible to change the appearance of a radio button using
> css?


Usually yes, but only in minor ways. Most of the presentation of UI
controls is dependent entirely on the browser and only minor
properties (such as background-color) are amenable to change through
CSS.

Some browsers may support additional CSS properties to set more
properties on an control, but these are browser-specific (AFAIR,
there's a bunch of these for Mozilla)

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Possible appearance of RFID at local supermarket Damos NZ Computing 17 04-25-2008 09:13 AM
ASP.NET Reset Radio Button in a group of Radio Buttons Scott D Johnson ASP .Net 1 09-27-2006 10:38 PM
Moz 1.7- how do you change appearance Gordon Abbot Firefox 2 04-10-2005 05:01 AM
Radio button List problem: How to find value of Radio button list's Selected Item using javascript?? Hiten ASP .Net Web Controls 1 05-26-2004 10:32 AM
Re: How to change appearance of Drop Down List control? bruce barker ASP .Net 1 08-13-2003 04:45 PM



Advertisments