Forum Moderators: not2easy
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Sample Form</title>
<style type="text/css">
input {width:500px; padding:3px; background:green; border:1px solid red;}
textarea {width:500px; height:150px; padding:3px; background:green ; border:1px solid red;}
</style>
</head>
<body>
<form action="">
<p><input id="entry_0"><label for="entry_0">Name</label></p>
<p><input id="entry_1"><label for="entry_1">Email</label></p>
<p><input id="entry_2"><label for="entry_2">URL</label></p>
<p><textarea id="entry_3" rows="5" cols="5"></textarea></p>
<p><input type="submit" value="Submit"></p>
</form>
</body>
</html> input type=submit uses a different box model, which kind of makes sense, IE and Firefox handle the padding on the input type=submit differently anyway, even if it was doing what you wanted regards width. <form action="">
<p><input></p>
<p><input></p>
<p><input></p>
<p><textarea rows="5" cols="5"></textarea></p>
<p><input class="submit" type="submit" value="Superlong button text Superlong button text Superlong button text Superlong button text Superlong button text"></p>
</form>
form {padding: 0; margin: 0; float: left; background: #ff0; /* added to show a yellow background for width testing */}
input, textarea {
background: #eee;
padding: 10px 50px; /* exaggerated for show */
border: 3px solid red;
width: 500px;
}
input {}
textarea {}
.submit {
padding: 10px 0;
width: 606px; /* 500px width + 100px left & right padding + 6px left & right border */
}
input type=submit without adding that extra class name .submit with input[type=submit] in the CSS <style type="text/css">
form {padding: 0; margin: 0; float: left; background: #ff0; /* added to show a yellow background for width testing */}
input, textarea {
background: #eee;
-moz-box-sizing: content-box; /* FF */
-webkit-box-sizing: content-box; /* Safari */
box-sizing: content-box; /* >=IE8 & Opera */
/* content-box is the default, it can be changed to border-box if you want borders and padding included in width but no support in lt IE8 */
padding: 10px 50px;
border: 3px solid red;
width: 500px;
}
input {}
textarea {}
</style>
<!--[if lt IE 8]>
<style type="text/css" media="screen">
.submit {width: 606px;}
</style>
<![endif]-->