Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

CSS Checkbox showing different in Firefox than IE

Posted on 2013-10-24
2
Medium Priority
?
396 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 58

Accepted Solution

by:
Gary earned 2000 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

CSS3 Custom checkboxes This article shows how to style the checkbox form element using only CSS. Works in: Chrome, FF, Safari, Opera, IE9+ Uses modernizr.js to check for :checked pseudo class, falling back to plain old checkboxes (IE8 and bel…
Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
In this tutorial viewers will learn how add a full-size background image to a webpage using CSS3. Create a new HTML document with an internal stylesheet.: In CSS, define the html element to have a background image. Use a high resolution image.: In t…
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…
Suggested Courses

715 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