確定按鈕和重置按鈕如何居中
<!DOCTYPE?HTML> <html> <head> <meta?http-equiv="Content-Type"?content="text/html;?charset=utf-8"> <title>文本域</title> </head> <body> <form?action="save.php"?method="post"?> ????用戶名:   <input?type="text"??name="my?Name"?/><br/> ????密碼:     <input?type="text"??name="my?Name"?/><br/> ????<label>個人簡介:</label> ????<textarea?cols="30"?rows="10">在這里輸入內(nèi)容...</textarea><br/> <table> ??<tr> ????<td?colspan="2"?align="center"> ????<input?type="submit"?value="確定"??name="submit"?/> ????<input?type="reset"?value="重置"??name="reset"?/> ????</td> ??</tr> </table> </form>? </body> </html>
如上所示,我是這樣寫的,為何沒有作用啊~
2016-08-26
居中是要有相對對象的,如果你希望相對上面?zhèn)€人簡介居中的話,只要下面代碼即可
<table>
? ?<tr>
? ? ? ?<td colspan="2" align="center">
? ? ? ? ? ?<label>個人簡介:</label>
? ? ? ? ? ?<textarea cols="30" rows="10">在這里輸入內(nèi)容...</textarea><br/>
? ? ? ? ? ?<input type="submit" value="確定" ?name="submit" />
? ? ? ? ? ?<input type="reset" value="重置" ?name="reset" />
? ? ? ?</td>
? ?</tr>
</table>
2016-08-26
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>文本域</title>
<style>
.test1{position:absolute;}
.test{position:relative;
left:50%;}
</style>
</head>
<body>
<form class="test1"action="save.php" method="post" >
? ? <label>個人簡介:</label>
? ? <textarea cols="50" rows="10">在這里輸入內(nèi)容...</textarea>
? ? <div class="test" >
? ? <input ?type="submit" ?value="確定" ?name="submit"/>
? ? <input type="reset" value="重置" ?name="reset" />
? ? </div>
??
</form>?
</body>
</html>
2016-08-26
上邊寫的有問題,這個測試過是可以的
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>文本域</title>
<style>
.ml{margin-left:100px}
</style>
</head>
<body>
<form action="save.php" method="post" >
? ? 用戶名:   <input type="text" ?name="my Name" /><br/>
? ? 密碼:     <input type="text" ?name="my Name" /><br/>
? ? <label>個人簡介:</label>
? ? <textarea cols="30" rows="10">在這里輸入內(nèi)容...</textarea><br/>
<div ?class="ml">
? ? <input type="submit" value="確定" ?name="submit" />
? ? <input type="reset" value="重置" ?name="reset" />
</div>
</form>?
</body>
</html>
2016-08-26
你可以設置style="align:center" 或者在CSS里設置margin屬性
2016-08-26
你可以設置<table?
align
=
"center"
>在頁面中間顯示,但是這樣應該不是你想要的效果,所以只能在css里面設置table的margin-right屬性 向右移動.2016-08-26
td標簽設置居中沒用用,要用table標簽設置<table ?align="center"></table>
2016-08-26
style="align:center"?