Labelling Radio Buttons : radio « Form « HTML / CSS






Labelling Radio Buttons

  

<?xml version="1.0" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitionalt//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
  <head>
    <title>Labelling Radio Buttons</title>
    <style rel="stylesheet" type="text/css">
body {
  color: #000000;
  background-color: #ffffff;
  font-family: arial, verdana, sans-serif;
  font-size: 12pt;
}

fieldset {
  font-size: 12px;
  padding: 10px;
  width: 250px;
}

label:hover {
  cursor: hand;
}
</style>
  </head>
  <body>

<form name="frmExample" action="" method="post">
<fieldset>
<legend>How did you hear about us?</legend>
  <input type="radio" id="referrer1" name="radReferrer" value="M" />
     <label for="referrer1" >W</label><br />
  <input type="radio" id="referrer2" name="radReferrer" value="G" />
     <label for="referrer2" >G</label><br />
  <input type="radio" id="referrer3" name="radReferrer" value="M" />
     <label for="referrer3" >M</label><br />
  <input type="radio" id="referrer4" name="radReferrer" value="Other" />
     <label for="referrer4" >Other</label>&nbsp;&nbsp;
  <input type="text" name="txtOther" size="12" /><br />
<input type="submit" value="Submit" />
</fieldset>
</form>

</body>
</html>

   
  








Related examples in the same category

1.input type = "radio" creates a radio button
2.radio button
3.Set input radio button background color and color
4.Creates a radio button
5.Use table to layout the radio buttons
6.Radio Button
7.Preselected Radio Example