如何在HTML中设置文本框位置 [英] How to set textbox position in HTML
本文介绍了如何在HTML中设置文本框位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
<style>
#text-position {
position: absolute;
bottom: 350px;
text-align: center;
width: 30%;
}
</style>
<div id="text-position">Enter Service Number</div><br>
<form>
<input type="text" align="left">
</form>
我尝试过:
< style>
#text-位置{
位置:绝对;
底部:350px;
text-align:center;
宽度: 30%;
}
< / style>
What I have tried:
<style>
#text-position {
position: absolute;
bottom: 350px;
text-align: center;
width: 30%;
}
</style>
输入服务编号
< form>
< input type =textalign =left>
< / form>
<form>
<input type="text" align="left">
</form>
推荐答案
我一直被限制在绝对定位HTML屏幕上的几乎所有控件(更正确的是,php,因为它们是在服务器端生成的。
I have been constrained to absolute positioning almost all of the controls on HTML screen (more correctly, php, as they're generated server-side).
<style type="text/css">
.textentry {
positions absolute;
top: 50px; /* I usually locate relative to top */
left: 100px; /* left corner of container (screen) */
height: 80px; /* often useful to keep screen orderly */
}
<form>
<input type="text" class="textentry" />
<body>
</body></form></style>br mode="hold" />
Now, one thing about positioning: there are often rules that you cannot position without being within a positioned entity. One way to solve this (and it usually is harmless, is <form style='position:absolute;top:0px;left:0px'> This restriction is generally quite useful - if you use the absolute positioning within a div, for example, locations can be absolute with respect to that div and the div (container) can be anywhere on the screen: think "console"
<br></br>
<form id="form1" runat="server">
<div>
<table>
<tr>
<td>Enter Service Number
</td>
<td>
<input type="text" align="left">
</td>
</tr>
</table>
</div>
</form>
这篇关于如何在HTML中设置文本框位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文