Css 如何选择除最后一个之外的所有元素
此css不应用于任何输入元素。您是否尝试过此操作Css 如何选择除最后一个之外的所有元素,css,Css,此css不应用于任何输入元素。您是否尝试过此操作 .fin-search-input input:not(:last-of-type){ height:13px !important; width:90%; border-radius: 2px; -webkit-border-radius: 2px; -moz-border-radius: 2px; -moz-box-shadow:inset 2px 2px 2px #888; box-s
.fin-search-input input:not(:last-of-type){
height:13px !important;
width:90%;
border-radius: 2px;
-webkit-border-radius: 2px;
-moz-border-radius: 2px;
-moz-box-shadow:inset 2px 2px 2px #888;
box-shadow:inset 2px 2px 2px #888;
}
你试过这个吗
.fin-search-input input:not(:last-of-type){
height:13px !important;
width:90%;
border-radius: 2px;
-webkit-border-radius: 2px;
-moz-border-radius: 2px;
-moz-box-shadow:inset 2px 2px 2px #888;
box-shadow:inset 2px 2px 2px #888;
}
:最后一个子项
选择器应该可以工作。我查过了。改为使用类型的last。:last of type
选择器匹配父元素的最后一个子元素(特定类型)
勾选此项:最后一个子项选择器应该可以工作。我查过了。改为使用类型的last。
:last of type
选择器匹配父元素的最后一个子元素(特定类型)
检查这个事实上,您当前的代码是有效的
:last child
可以通过这种方式与:not
实际上,您当前的代码可以正常工作
:last child
可以通过这种方式与:not
您的选择器似乎是错误的,在您发布的HTML中,每个
输入
都是其父元素中类型的最后一个。您需要选择类型的
元素中包含的输入
(我假设):
.您的选择器似乎是错误的,在您发布的HTML中,每个输入
都是其父元素中类型的:最后一个。您需要选择类型的
元素中包含的输入
(我假设):
.这不是您真正的代码,因为您给出的代码应该可以正常工作。请给我们看一下你的真实代码。@BoltClock我还用最后一种类型指出了我的代码。。仍然不起作用。fin-search-input[type=text]这在我的场景中起作用。@user2536373您使用的是哪种浏览器?这不是您真正的代码,因为您给出的代码应该可以正常工作。请给我们看一下你的真实代码。@BoltClock我还用最后一种类型指出了我的代码。。仍然不起作用。fin-search-input[type=text]这在我的场景中起作用。@user2536373您使用的是哪种浏览器?
.fclass input:not(:last-of-type) { color:red }
.fin-search-input li:not(:last-of-type) input {
/* css */
}