Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/36.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/typo3/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Css 如何选择除最后一个之外的所有元素_Css - Fatal编程技术网

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

此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-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 */
}