Php 如何设置窗体框的大小?
我正在使用这个表单,它应该在dreamweaver中出现,但当我在网站上使用它时,它又变大了。该站点通过include as dynamic content php加载Php 如何设置窗体框的大小?,php,html,forms,Php,Html,Forms,我正在使用这个表单,它应该在dreamweaver中出现,但当我在网站上使用它时,它又变大了。该站点通过include as dynamic content php加载 <form action="index.php" method="get"> <input type="hidden" name="content" value="home" /> <label>Go to <input style h
<form action="index.php" method="get">
<input type="hidden" name="content" value="home" />
<label>Go to
<input style height="20" width="40" type="numeric" name="page" />
</label>
<input type="submit" value="Go" />
</form>
谢谢你的帮助 添加样式=宽度:Npx;高度:Mpx;如果需要,支持不推荐的宽度和高度HTML属性
例如:
<form action="index.php" method="get">
<input type="hidden" name="content" value="home" />
<label>Go to
<input style="height:20px; width:40px" type="numeric" name="page" />
</label>
<input type="submit" value="Go" />
</form>
添加样式=宽度:Npx;高度:Mpx;如果需要,支持不推荐的宽度和高度HTML属性
例如:
<form action="index.php" method="get">
<input type="hidden" name="content" value="home" />
<label>Go to
<input style="height:20px; width:40px" type="numeric" name="page" />
</label>
<input type="submit" value="Go" />
</form>
或者,使用CSS中的width属性:元素默认显示为块,因此它在其父元素的整个宽度上伸展;或者,使用CSS中的width属性:元素默认显示为块,因此它在其父元素的整个宽度上伸展,尽管这里的其他答案可能会起作用,最好避免使用内联样式标记 实际上,您应该设置一个CSS样式表,给输入元素一个类,并在样式表中为这个类设置所需的样式。这样做的好处是,如果你的网站中有这样一个超过表单的元素,你只需添加类名,它就会以同样的方式出现。如果你改变了事物的外观,这一点尤其重要
使用CSS有一个学习曲线,但从长远来看,它会获得很多回报。尽管这里的其他答案可能会起作用,但最好避免使用内联样式标记 实际上,您应该设置一个CSS样式表,给输入元素一个类,并在样式表中为这个类设置所需的样式。这样做的好处是,如果你的网站中有这样一个超过表单的元素,你只需添加类名,它就会以同样的方式出现。如果你改变了事物的外观,这一点尤其重要 使用CSS有一个学习曲线,但从长远来看,它会获得很多回报