Solved

CSS Checkbox showing different in Firefox than IE

Posted on 2013-10-24
2
392 Views
Last Modified: 2013-10-24
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
Comment
Question by:stkoontz
2 Comments
 
LVL 58

Accepted Solution

by:
Gary earned 500 total points
ID: 39598731
Why are you setting the width of the checkbox to 200px - that will make the actual checkbox appear in the center.
0
 
LVL 2

Author Closing Comment

by:stkoontz
ID: 39598759
That's probably the easiest 500 points you've made.  :)  Removing the 200 px width did the trick.  

Thanks!
0

Featured Post

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
This article discusses four methods for overlaying images in a container on a web page
In this tutorial viewers will learn how add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…
In this tutorial viewers will learn how to customize the background color and font color of highlighted text using the ::selection element in CSS Begin by defining the selected text as an element in CSS by typing "::selection": Style the ::selection…

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question