gpt4 book ai didi

html - 指定输入类型名称?

转载 作者:行者123 更新时间:2023-11-28 04:37:10 24 4
gpt4 key购买 nike

我正在制作联系表。现在显然我希望消息框比电子邮件和主题输入框大。所以很明显我不能只在 css 中输入我的输入,因为它会改变所有框。我以为指定消息框会像这样

input [type="text" name="message"] {
padding-bottom: 500px;
}

那显然是行不通的...那么我做错了什么?

HTML

<div id="contactContent">
<form>
<label>Email:</label><input type="text" name="email" />
<br>
<label>Subject:</label><input type="text" name="subject" />
<br>
<label>Message:</label><input type="text" name="message" />
</form>
</div>

CSS

#contactContent { 
margin-top: 50px;
margin-left: 350px;
}
input {
border: none;
background-color: #CCCCCC;
margin-left: 20px;
margin-bottom: 5px;
padding-right: 250px;
padding-top: 13px;
padding-bottom: 13px;
}
label {
display:inline-block;
width:100px;
font-family:maven;
color: #FF6464;
font-size: 20px;
text-align: right;
}
input [type="text" name="message"] {
padding-bottom: 500px;
}

最佳答案

您的选择器不正确,通过元素的类型和名称将样式应用到元素的正确方法是:

input[type="text"][name="message"] {
padding-bottom: 500px;
}

尽管您最好使用类或 ID 来定位元素,除非您有充分的理由这样做。

关于html - 指定输入类型名称?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16611687/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com