我有这个脚本,并尝试更改文本区域的宽度和高度,但运行代码时没有变化。
这是我的代码:
<td style="width:200; height:400" width="200">
<textarea name="teamnews_text" size="300" cols="32" class="form-control">
<?php echo htmlentities($row_all_players['playerNews_text'], ENT_COMPAT, 'utf-8'); ?>
</textarea>
</td>
答案 0 :(得分:1)
textarea不遵循正常的大小调整规则。
尝试添加此css:
box-sizing: border-box
答案 1 :(得分:1)
使用rows
(非尺寸)和cols
作为属性,或使用width
和height
作为样式。
答案 2 :(得分:1)
试用此代码 - 希望它能为您效用
<td style="width:200; height:400" width="200" >
<textarea name="teamnews_text" class="custom">
<?php echo htmlentities($row_all_players['playerNews_text'], ENT_COMPAT, 'utf-8'); ?>
</textarea>
</td>
<style type="text/css">
.custom{
width: 100%;
height: 100%;
}
</style>