Luc*_*ucy 10 html css forms layout
我想以图片中显示的格式重新调整文本区域的标签.我正在尝试使用段落标签来做worp,但它没有发生..
我的代码......
<label for="qual">This is the format i want the text-area to be displayed:</label>
<textarea id="qual" rows="5" cols="50" style="resize:none" placeholder="Description and Qualification"></textarea><br><br>
Run Code Online (Sandbox Code Playgroud)
期望的输出..

Ger*_*rtV 13
style="max-width: 140px; word-wrap: break-word"
Run Code Online (Sandbox Code Playgroud)
将其放在标签标签中,并根据需要调整最大宽度或最小宽度.抬头在IE中不起作用
这是解决方案.
HTML:
<label for="qual" class="abc">This is the format i want the text-area to be displayed:</label>
<textarea id="qual" rows="5" cols="50" style="resize:none" placeholder="Description and Qualification"></textarea>
Run Code Online (Sandbox Code Playgroud)
CSS:
.abc{float:left; width:125px; text-align:left; margin-right:30px;}
Run Code Online (Sandbox Code Playgroud)
如果您不想创建类,可以label在CSS中应用样式.
希望这可以帮助.
像这样的东西:
label {
float: left;
width:120px;
padding:10px 30px;
font-weight:bold;
}
Run Code Online (Sandbox Code Playgroud)