Welcome to WebmasterWorld Guest from 54.198.118.102

Forum Moderators: not2easy

Message Too Old, No Replies

Having trouble styling radio buttons and check boxes

     
3:39 pm on Mar 21, 2012 (gmt 0)

New User

5+ Year Member

joined:Jan 17, 2010
posts: 23
votes: 0


Hi,
I have no experience of styling radio buttons or check boxes. So please bear with me. On the form shown I want to reduce the gap between the label Gender and the radio buttons so that the buttons sit somewhere (not exactly) underneath IT, also wish to reduce the gaps between the buttons and the words Male and Female. I wish the same for the check boxes. I would be very grateful for your help.


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Temporary</title>
<style type="text/css">
body
{ margin: 0;
padding:0;
}
p
{ margin: 0 0 10px 0;
padding:0;
}
form
{ font: 13px Georgia, "Times New Roman", Times, serif;
background: #eee;
margin: 20px;
padding: 10px 20px;
width: 330px;
}
form ol
{ list-style: none;
margin: 0;
padding: 0;
}
form li
{ padding: 6px;
background: #e1e1e1;
margin-bottom: 1px;
}
form label
{ float: left;
width: 70px;
text-align: right;
margin-right: 7px;
color: #0066CC;
line-height: 23px;
}
form input
{ padding: 4px;
font: 13px Georgia, "Times New Roman", Times, serif;
border: 1px solid #999999;
width: 200px;
}
form input:focus
{ border: 1px solid #666;
background: #e3f1f1;
}
</style>
</head>

<body>

<form>

<p>Upload your educational and employment details:</p>

<ol>

<li>
<label for="name">Name</label>
<input type="text" name="name" id="name" />
</li>

<li>
<label for="email">Email</label>
<input type="text" name="email" id="email" />
</li>

<li>
<label for="jobs">Job Sought</label>
<select name="jobs">
<option value="clerical">Clerical</option>
<option value="teaching">Teaching</option>
<option value="computer" selected="selected">IT</option>
<option value="driver">Driver</option>
<option value="building">Construction</option>
</select>
</li>

<li>
<label for="gender">Gender</label>
<input type="radio" name="gender" value="male" /> Male<br />
<input type="radio" name="gender" value="female" /> Female
</li>

<li>
<label for="education">Education</label>
<input type="checkbox" name="education"
value="school" /> Secondary School<br />
<input type="checkbox" name="education"
value="college" /> Further Education College<br />
<input type="checkbox" name="education"
value="university" /> Higher Education
</li>

</ol>

</form>

</body>
</html>
6:22 pm on Mar 21, 2012 (gmt 0)

Junior Member

5+ Year Member

joined:Feb 7, 2010
posts: 119
votes: 0


You could nest a list within a list, that would 'stack' your <li> elements.


<ul>
<li>
<ul>
<li>male</li>
<li>female</li>
</ul>
</li>
</ul>
 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members