navigation
Thomas Brunt's OutFront Hosting
 
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Microsoft MVP
 

Creating Funky Forms with CSS  Part IV  
by Outfront Moderator Katherine Nolan (abbeyvet)

Styling radio buttons and check boxes

Radio buttons are a little different when it comes to adding a style. If you look at the html you will see that the code for a radio button looks like this:

<input type="radio" value="V1" checked name="R1">

So again we are dealing with the selector 'input'. Now lets see what happens if we add the class 'red' to this to make it red:

<input class="red" type="radio" value="V1" checked name="R1">

Option1
Option 2
Option 3

As you will see what happens is not that the background of the little circle becomes red, but a red square is created around it. This can be very useful if you are creating a form on a colored background, where normally an ugly white square will surround the radio button in some versions of Netscape. Adding a class with a background color the same as the page will overcome this. 

Look at this in NN to see what happens. The radio button for Option 2 will have a white surround in spite of the red background, Option 3, to which the class was added, will not. In Internet Explorer they will both look the same.

Option1
Option 2
Option 3

If you apply the style 'red' to all the radio buttons on a white or other colored background then you can get the effect of a red bar containing the buttons alongside the text, which can look interesting in some situations.
Browser Note: This does not work too well in Netscape, the 'red bar' has a broken up appearance.

Option1
Option 2
Option 3

Check boxes behave in exactly the same way as radio buttons, that is the color applied will surround the box rather than effect its background. Here the input class 'red' has been added to all three checkboxes, the first in a white cell, the second in a pink cell, the third in a red cell.

Option 1

Option 2

Option 3

As you can see with a bit of imagination there is a lot you can do to perk up the appearance of a standard set of options.

Browser Note: Mostly these work fine in Netscape, but it is a good idea to test before you are satisfied.

>>Part V: Colorful dropdown lists

<<Part III: Fun with radio buttons and check boxes

 

Fun With Background Images
Fun With Bulleted Lists
Are You Compliant?
Introduction To Cascading Style Sheets
Creating Custom Error Pages
Designing Fast Loading Sites
Creating Funky Forms With CSS
htaccess Magic
An Introduction To JavaScript
JavaScript Snippets
Getting More From Mailto
Installing And Using Perl Scripts
Preparing Photos For Your Web Site
The Popup Dilemma
Paint Shop Pro Album 4
Creating And Using robots.txt File
Creating JavaScript Rollover Buttons

Microsoft Corporation in no way endorses or is affiliated with "OutFront." 
OutFront is published and edited by Thomas Brunt
440 Great Circle Dr., St. Matthews, SC 29135.  803-655-6151
© 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 All Rights Reserved
Click here to view our privacy statement.