2011-02-03 143 views

回答

0

如果您使用CSS,一个简单的宽度和高度属性工作得很好。

textarea {height:100px; width:100px; } 
-1

您还可以指定textarea的行和列属性来控制它们的大小。行是水平线和cols是字符数宽你想要的texarea是

<textarea name="myText" rows="10" cols="80">Enter some text</textarea> 

提供相当短而宽的textarea。

2

阅读这些例子 - http://www.w3schools.com/css/css_reference.asp#dimension

<html> 
<head> 
    <style type="text/css"> 
     input {height:100px; width:200px; } 
    </style> 
</head> 
<body> 
     <input type="text" /> 
</body> 

在这种情况下,所有的HTML “输入型” 将有100倍的高度和宽度200像素。相反,如果您使用“班级”,则只会设计那些指定了特定班级的元素。

​​3210

您还可以使用该特定HTML元素的 “身份证”。 ID应该是在HTML页面中唯一

<html> 
<head> 
    <style type="text/css"> 
     #tb {height:100px; width:200px; } 
    </style> 
</head> 
<body> 
<input type="text" id="tb"/> 
<br /> 
<input type="text" /> 
</body> 

0

你也可以写这样一来,

<html> 
<head> 
<style type="text/css"> 
input[type=text] {height:50px;width:200px;} 
</style> 
</head> 
<body> 
<input type="text" /> 
</body>