【发布时间】:2021-11-27 10:37:55
【问题描述】:
知道为什么当我在表单标签上使用 id 时样式无效,但在将 id 替换为 class 后它变得有效
<form id="contact-form">
<label>Subject</label>
<input class="input-field" type="text" name="subject">
<label>Email</label>
<input class="input-field" type="text" name="email">
<label>Message</label>
<input id="submit-button" type="submit" value="Send">
</form>
#contact-form{
display: block
}
【问题讨论】:
-
页面中是否有另一个带有那个(contact-form)ID 的元素?
-
这是唯一具有该特定 id 的标签
标签: html css class responsive-design styling