问题不是 CSS 本身,而是我的浏览器的缓存错误
section input {
min-width: 100px;
}
<section id="protokoll">
<form action="protokollAbfrage.php" method="post">
<label class="h3" for="KW">New week:</label><br>
<input type="text" id="KW" name="KW" placeholder="KW **" required/><br><br>
<label class="h3" for="TITEL">New title:</label><br>
<input type="text" id="TITEL" name="TITEL" required /><br><br>
<label class="h3" for="INHALT">New subtitle:</label><br>
<input type="text" id="INHALT" name="INHALT" required/><br><br>
<label class="h3" for="TEXT">New text:</label><br>
<textarea id="TEXT" name="TEXT" required <></textarea><br><br>
<a href=""><button> <?php echo "Submit new Article";?></button></a>
</form>
我尝试过类似的东西:
section input { min-width: 500px; }
但这没有效果
据我所知,您希望增加输入和文本框的宽度。
要实现此目的,您可以使用
width
CSS 属性
section#protokoll input,
section#protokoll textarea {
width: 440px;
}
<section id="protokoll">
<form action="protokollAbfrage.php" method="post">
<label class="h3" for="KW">New week:</label><br>
<input type="text" id="KW" name="KW" placeholder="KW **" required/><br><br>
<label class="h3" for="TITEL">New title:</label><br>
<input type="text" id="TITEL" name="TITEL" required /><br><br>
<label class="h3" for="INHALT">New subtitle:</label><br>
<input type="text" id="INHALT" name="INHALT" required/><br><br>
<label class="h3" for="TEXT">New text:</label><br>
<textarea id="TEXT" name="TEXT" required></textarea><br><br>
<a href=""><button> Submit new Article </button></a>
</form>
</section>
此外,我还添加了
section#protokoll
来指定要修改哪个部分的输入。