Solved

CSS Checkbox showing different in Firefox than IE

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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

This is a how to build your own CSS3 slideshow and when I say CSS3 I mean just CSS with no javascript in sight! There a few examples online of how to do this but most just show you an example without any explanation, others make it more complicat…
CSS is a visual language used to classify objects and define rules about how they should be displayed. CSS skills aren’t restricted to developers anymore, there is a big benefit to having a basic understanding of the language, regardless of your occ…
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…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

707 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

20 Experts available now in Live!

Get 1:1 Help Now