使用 CSS 更改输入和文本区域大小(已解决)

问题描述 投票:0回答:1

问题不是 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; }
但这没有效果

html css
1个回答
0
投票

据我所知,您希望增加输入和文本框的宽度。

要实现此目的,您可以使用

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
来指定要修改哪个部分的输入。

© www.soinside.com 2019 - 2024. All rights reserved.