html - 如何在css中管理两个不同大小的textarea框

标签 html css

在 css 中我需要两个不同大小的文本框。 enter image description here

我的 Jsfiddle 代码链接是:--- jsfiddle link

但现在我得到了相同的 textarea..我做错了什么???

最佳答案

您可以分配两个不同的 ID,然后设置它们的样式:

<div class = "tablebox">   
<form>
<label for="emailaddress">address</label>
<textarea cols="73" rows="12" name="descr" id="texta1"></textarea><br />
<label for="comments">About you </label>
<textarea name="comments" id="texta2"></textarea><br />
</form>
</div>

CSS:

.tablebox 
{

  width: 100%;
  background-color: #F7F7F7;
  margin: 0 auto 10px;
  border-radius: 2px;
  box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.3);

}

label{
float: left;
width: 100%;
margin-left:10px;
margin-top:10px;
margin-bottom:10px;
font-weight: bold;
}

input{
width: 80%;
margin-bottom: 5px;
}

textarea{
width: 50%;
height: 300px;
}

#texta1{
width: 30%;
height: 300px;
}

#texta2{
width: 70%;
height: 300px;
}

关于html - 如何在css中管理两个不同大小的textarea框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32494866/

相关文章:

javascript - 保持 JavaScript 和 CSS 同步的做法?

jQuery - 链接到 ul.tabs 之外的选项卡

php - 同一文件根据 HTML 或 PHP 文件扩展名显示不同

html - MVC : Send parameters to method by a button

php - fatal error : Cannot use isset() on the result of an expression

html - CSS背景图像以适应宽度,高度应按比例自动缩放

CSS 属性的 Python 文件内容替换

html - 如何在 Angular 6 中将值从 typescript 代码传递到 css

html - 使用 twitter bootstrap v3 需要 div 之间的间距

html - 在 AngularJS 中查找颜色相对于另一种颜色的百分比