我在
這是HTML:
<fieldset>
<legend>Essay Section</legend>
<div>
<label for="essay_reasons">In 50 words or more explain why you want to apply for this course</label>
</div>
<div>
<textarea id="essay_reasons" name="essay_reasons" rows="4" cols="55" placeholder="Enter text here">
</textarea>
</div>
</fieldset>
CSS:
/*. generic selectors. */
.container {
width: 85%;
margin: 0 auto;
max-with: 1184px;
}
div {
margin-top: 1.5em;
}
/*. specific design. */
form {
border-radius: 10px;
border: 1px solid #777;
padding: 1em 3em;
margin-top: 10em;
background-color: #fff;
}
input:focus {
border: 2px solid red;
}
fieldset {
margin: 1em auto;
border: 0.5px solid #777;
}
textarea {
resize: none;
max-width: 95%;
}
uj5u.com熱心網友回復:
使用屬性設定文本區域的樣式cols="value",rows="value"您將在不同瀏覽器之間實作一致的樣式。但是與僅使用 CSS 的樣式相比,您將沒有那么多的控制權。
我會洗掉你的 textarea屬性并在你的樣式表中cols="55"設定寬度:width: 100%
textarea {
resize: none;
width: 100%;
}
<textarea id="essay_reasons" name="essay_reasons" rows="4" placeholder="Enter text here" />
uj5u.com熱心網友回復:
在欄位集或包含所有內容的主包裝器上進行填充(欄位集,文本區域)
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/425172.html
上一篇:使用CSS內部帶有放大鏡的搜索欄
下一篇:使用表單創建和更新模型物件
