views:

29

answers:

3

Hi, I have the following code:

<html>
<head>
<style type="text/css">
li {list-style-type:none;}
label {clear:left;float:left;width:110px;}
input.submit {display:block;margin:20px 0 10px 110px;padding:4px 0;width:140px; }
</style>
</head>
<body>
<li><label>Full Name:&nbsp;</label><input type="text"></li>
<li><label>E-mail Address:&nbsp;</label><input type="text"></li>
<input type="submit" class="submit" value="Click to continue">
</body>
</html>

Notice how the "Click to Continue" button lines up in FF but not in IE. I know it's because a doctype is not declared and IE is running in quirks mode. What I'd like to know is if there's a way to line that button up without declaring a doctype and without using an IE-only CSS hack? I know it's an odd question... Thanks!

+4  A: 

at first you should put the li's into an ul (or remove them, but what you're doing is definitely wrong) - maybe that solves you problem.

oezi
+1  A: 

correct doctype, correct markup, that should fix it

revaxarts
He specified quirks mode. -1
Ryan Kinal
@revaxarts: What a useful answer.
jimplode
It is *always* the proper way to go, but does not answer the op's question.
Traingamer
+3  A: 

This will do it

<html>
<head>
<style type="text/css">
li {list-style-type:none;}
label {clear:left;float:left;width:110px;}
input.submit {display:block;margin:20px 0 10px 110px;padding:4px 0;width:140px; }
ul {margin:0px;padding:0px;}
</style>
</head>
<body>
<ul>
<li><label>Full Name:&nbsp;</label><input type="text"></li>
<li><label>E-mail Address:&nbsp;</label><input type="text"></li>
</ul>
<input type="submit" class="submit" value="Click to continue">
</body>
</html>
jimplode
That looks good to me. Since IE and FF have different defaults (quirks or otherwise), jimplode is specifically equalizing the padding and margin on the ul tag!
Traingamer