Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 398
  • Last Modified:

CSS Checkbox showing different in Firefox than IE

I'm using code from http://24ways.org/2009/have-a-field-day-with-html5-forms/ to help me style forms (and learn more CSS).

The problem is that the checkbox element behaves differently in Firefox than in IE.  I want the checkbox to be on the left of the box like IE, not toward the middle like Firefox. I set up a very simple page here http://buildmomentum.org/register/test2.php to see the difference.  (I'm using Firefox 24 and IE 10)

I've tried floating and aligning every element that's possible without any effect.  The code is below.

I appreciate any help given.

Thanks,

Steve

@charset "utf-8";
/* CSS Document 
Code based on http://24ways.org/2009/have-a-field-day-with-html5-forms/
*/

.label {width:100px;text-align:right;float:left;padding-right:10px;font-weight:bold;}
#register-form label.error, .output {color:#FB3A3A;font-weight:bold;}

.hide{
  display:none;
}body {
	font-family: Georgia, "Times New Roman", Times, serif;
	font-size: 16px;
}
clear {
	float: none;
}

html, body, h1, form, fieldset, legend, ol, li {
	margin: 0;
	padding: 0;
}
body {
	background: #ffffff;
	color: #111111;
	font-family: Georgia, "Times New Roman", Times, serif;
	padding: 20px;
}

form#payment {
	background: #9cbc2c;
	-moz-border-radius: 5px;
	-webkit-border-radius: 5px;
	border-radius: 5px;
	padding: 20px;
	width: 1000px;
	margin-right: auto;
	margin-left: auto;
}

form#payment fieldset {
	border: none;
	margin-bottom: 10px;
}
form#payment fieldset:last-of-type {
	margin-bottom: 0;
}

form#payment legend {
	color: #384313;
	font-size: 16px;
	font-weight: bold;
	padding-bottom: 10px;
	text-shadow: 0 1px 1px #c0d576;
}

form#payment fieldset fieldset legend {
	color: #111111;
	font-size: 13px;
	font-weight: normal;
	padding-bottom: 0;
}

form#payment ol li {
	background: #b9cf6a;
	background: rgba(255,255,255,.3);
	border-color: #e3ebc3;
	border-color: rgba(255,255,255,.6);
	border-style: solid;
	border-width: 2px;
	-moz-border-radius: 5px;
	-webkit-border-radius: 5px;
	border-radius: 5px;
	line-height: 20px;
	list-style: none;
	padding: 5px 10px;
	margin-bottom: 2px;
}
form#payment ol ol li {
	background: none;
	border: none;
}

form#payment label {
	font-size: 13px;
	width: 110px;
}
form#payment fieldset fieldset label {
	background:none no-repeat left 50%;
	line-height: 20px;
	padding: 0 0 0 30px;
	width: auto;
}
form#payment label[for=visa] {
	background-image: url(visa.gif);
}
form#payment label[for=amex] {
	background-image: url(amex.gif);
}
form#payment label[for=mastercard] {
	background-image: url(mastercard.gif);
}
form#payment fieldset fieldset label:hover {
	cursor: pointer;
}

form#payment input:not([type=radio]),
form#payment textarea {
	background: #ffffff;
	border: none;
	-moz-border-radius: 3px;
	-webkit-border-radius: 3px;
	-khtml-border-radius: 3px;
	border-radius: 3px;
	font: italic 13px Georgia, "Times New Roman", Times, serif;
	outline: none;
	padding: 5px;
	width: 200px;
}
form#payment input:not([type=submit]):focus,
form#payment textarea:focus {
	background: #eaeaea;
	text-align: left;
}
form#payment input[type=radio] {
	float: left;
	margin-right: 5px;
}

form#payment input[type=checkbox] {
	float: left;
	margin-right: 5px;
}

form#payment button {
	background: #384313;
	border: none;
	-moz-border-radius: 20px;
	-webkit-border-radius: 20px;
	-khtml-border-radius: 20px;
	border-radius: 20px;
	color: #ffffff;
	display: block;
	font: 18px Georgia, "Times New Roman", Times, serif;
	letter-spacing: 1px;
	margin: auto;
	padding: 7px 25px;
	text-shadow: 0 1px 1px #000000;
	text-transform: uppercase;
}
form#payment button:hover {
	background: #1e2506;
	cursor: pointer;
}

Open in new window


The HTML is here
<body>
<form id="payment" name="payment" method="post" action="">
<fieldset>
<legend>Skills Survey</legend>
<ol>
     <li><input name="skill_games" type="checkbox" id="skill_games" value="Yes" />
      Organizing and leading group games
      </li>
      </ol>
</fieldset>
<input type="submit" name="button" id="button" value="Next" />      
</form>
</body>

Open in new window

0
stkoontz
Asked:
stkoontz
1 Solution
 
GaryCommented:
Why are you setting the width of the checkbox to 200px - that will make the actual checkbox appear in the center.
0
 
stkoontzAuthor Commented:
That's probably the easiest 500 points you've made.  :)  Removing the 200 px width did the trick.  

Thanks!
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now