无法在文本框下显示SUBMIT框

时间:2014-10-25 08:09:12

标签: html css

所以我有一个问题,"提交" box doesent显示在"密码输入"下面。所以我想知道你是否可以帮助我。谢谢你的回答。我不是一个专业的程序员,所以记住这一点。



<!DOCTYPE html>
<html>
<head>
<title>HelloWorld</title>
<script type="text/javascript"
src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-
1.8.1.min.js">
</script>
<style type="text/css">

.form-field{
	clear:both;
	padding: 10px;
	width: 400px;
	
}
.form-field label {
	float: left;
	width: 150px;
	text-align: right;
}
.form-field input{
	float: right;
	width: 150px;
	text-align: left;
	
}
#submit{
	text-align: center;
}

</style>
</head>
<body>
<form class="form-field">
	<fieldset>
		<legend>Log In: </legend>
		<div>
			<label for="username">Username:</label>
			<input type="text" name="username" id="Uname">
		</div>
		<div>
			<label for="password">Password:</label>
			<input type="password" name="password" id="password">
		</div>
			<input type="submit" id="Submit" value="Submit">
	</fieldset>
</form>
</body>
</html>
&#13;
&#13;
&#13;

2 个答案:

答案 0 :(得分:1)

只需添加'br'标签,这只是新行。这是代码

<!DOCTYPE html>
<html>
<head>
<title>HelloWorld</title>
<script type="text/javascript"
src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-
1.8.1.min.js">
</script>
<style type="text/css">

.form-field{
	clear:both;
	padding: 10px;
	width: 400px;
	
}
.form-field label {
	float: left;
	width: 150px;
	text-align: right;
}
.form-field input{
	float: right;
	width: 150px;
	text-align: left;
	
}
#submit{
	text-align: center;
}

</style>
</head>
<body>
<form class="form-field">
	<fieldset>
		<legend>Log In: </legend>

		<div>
			<label for="username">Username:</label>
			<input type="text" name="username" id="Uname">
		</div>
<br>
<br>
		<div>
			<label for="password">Password:</label>
			<input type="password" name="password" id="password">
		</div>
<br>
<br>
			&nbsp;<input type="submit" id="Submit" value="Submit">
<br>
<br>
	</fieldset>
</form>
</body>
</html>

希望这有助于你!!

答案 1 :(得分:1)

非常简单

<label>&nbsp;</label>
<input type="submit" id="Submit" value="Submit">

为提交按钮设置一个空标签