在CSS中有一个选择器来引用一个特定的输入类型,也有一个类? [英] In CSS is there a selector for referencing a specific input type that also has a class?
本文介绍了在CSS中有一个选择器来引用一个特定的输入类型,也有一个类?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
基本上,我想要一个CSS选择器,抓取所有的输入[type =text],但也有一个类some-class。
以下似乎并不适用于我:
input [type =text] .some-class { *不工作* /
pre>
.some-class输入[type =text] {} / *不起作用* /
我确定我在这里缺少一些简单的东西。提前感谢。
解决方案您想要
input.some-class [type =text]
.some类输入
查找作为.some-class
。
input.some-class
Basically I want a CSS selector that grabs all input[type="text"] but that also has a class "some-class".
Both of the following don't seem to be working for me:
input[type="text"] .some-class {} /* doesn't work */ .some-class input[type="text"] {} /* doesn't work */
I'm sure I'm missing something simple here. Thanks in advance.
解决方案You want
input.some-class[type="text"]
.some-class input
looks for input tags that are descendants of.some-class
.
input.some-class
does the reverse.这篇关于在CSS中有一个选择器来引用一个特定的输入类型,也有一个类?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文