Solved

CSS Checkbox showing different in Firefox than IE

Posted on 2013-10-24
2
390 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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
align Linkedin sign to the right page 5 34
Applying an inline style that applies to child elements 2 48
Change javascript css 1 30
div to fit another div 8 20
Unordered lists (HTML ul tags) are very handy to create menus of all types, shapes and sizes.  All it takes is a little knowledge of CSS and the possibilities are endless. First off, you should know the general format for menus created using the …
Introduction If you're like most people, you have occasionally made a typographical error when you're entering information into an online form.  And to your consternation, the browser remembers the error, and offers to autocomplete your future entr…
In this tutorial viewers will learn how to define a gradient in CSS. Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Gradient. Define the background as "linear-gradient(to right, #ee3668, black)". Ensure you …
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…

813 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now