将<button = type>与.CSS对齐

时间:2015-05-16 14:25:01

标签: html css

&#13;
&#13;
.signupH {
	background-color:#9FADBC;
	color:white;
	border-top-left-radius:10px;
	border-top-right-radius:10px;
	width:300px;
	height:18px;
	font-family:Tahoma, Geneva, sans-serif;
	font-weight:3px;
	text-align:center;
	margin-top:-10px;
	margin:auto;
	position:absolute;
	top:0;
	left:0;
	bottom:20;
	right:0;
    padding:10px;
	}

.signupback {
	background-color:#55789e;
	width:300px;
	height:210px;
    margin:auto;
	position:absolute;
	top:0;
	left:0;
	bottom:0;
	right:0;
    padding:10px;
	webkit-border-radius: 10px;
	khtml-border-radius: 10px;	
	moz-border-radius: 10px;
	border-radius: 10px;
	}
&#13;
<body bgcolor="#215698">

	<div class="signupback">
	<table>
			<center><div class="signupH">
				Graphicx | Sign up
			</div></center>
		<br>
	<form role="form" action="login-post.php" method="POST">
	<table align="middle">
	<tr>
	<td>
		Username:
	</td>
	<td>
						
						<input id="username" type="text" value="username" 
						onfocus="this.value = this.value=='username'?'':this.value;" 
						onblur="this.value = this.value==''?'username':this.value;", >
						
	</td>
	</tr>
	<tr>
	<td>
		Email:
	</td>
	<td>
						<input id="email" type="text" value="email" 
						onfocus="this.value = this.value=='email'?'':this.value;" 
						onblur="this.value = this.value==''?'email':this.value;", >
	</td>
	</tr>
	<tr>
	<td>
		Password:
	</td>
	<td>
						<input id="password" type="password" value="password" 
						onfocus="this.value = this.value=='password'?'':this.value;" 
						onblur="this.value = this.value==''?'password':this.value;", >
	</td>
	</tr>
			
					<center><button type="submit" class="button">Sign up</button></center>

	</form>
	</div>
	</table>
		<br>	
				
							
</body>
&#13;
&#13;
&#13;

按钮放在表单的顶部,我需要它在用户名,电子邮件和密码文本字段下。有人可以帮我解决这个错误吗?

我需要移动文本字段下方的按钮,但仍需要在form属性中将其与我的SQL数据库连接。

帮助!!!

2 个答案:

答案 0 :(得分:0)

尝试将其放入另一组表格行标记中:

</td>
</tr>
<tr>
<td>        
                <center><button type="submit" class="button">Sign up</button></center>
</td>
</tr>

</form>

...或者通过赋予它以下属性使其成为CSS中的块元素:

style="display:block"

答案 1 :(得分:0)

我刚从输入中移动了html下面的类“center”的html并且它有效。您的代码段代码与您在问题中链接的内容不符。