gpt4 book ai didi

html - 如何为特定输入类型文本添加 css

转载 作者:技术小花猫 更新时间:2023-10-29 12:21:44 25 4
gpt4 key购买 nike

当我尝试使用 css 添加一些输入字段时

我有一个问题

我不能为某些输入字段制作多个 css

这是我的字段

<input type="text" name="firstName" />
<input type="text" name="lastName" />

CSS 是

input
{
background-image:url('images/fieldBG.gif');
background-repeat:repeat-x;
border: 0px solid;
height:25px;
width:235px;
}

我想用这个 css 制作第一个字段 (firstName)

input
{
background-image:url('images/fieldBG.gif');
background-repeat:repeat-x;
border: 0px solid;
height:25px;
width:235px;
}

第二个 (lastName) 使用这个 css

input
{
background-image:url('images/fieldBG2222.gif');
background-repeat:repeat-x;
border: 0px solid;
height:25px;
width:125px;
}

请帮忙:-)

最佳答案

您可以使用 CSS 按类型设置样式或命名表单元素。

input[type=text] {
//styling
}
input[name=html_name] {
//styling
}

关于html - 如何为特定输入类型文本添加 css,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10589304/

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