J-b*_*bob 5 html css css-selectors
我想为用户选择的所有元素创建一些通用样式(使用鼠标或在触摸屏上点击),然后使用光标输入文本.这包括:
<input><input type='text'><textarea><input type='password'><another element that I didn't know existed that you can type into>正如你所看到的(以及其他可能的例子),由于<textarea>(属于这一类)和<input type='submit'>(不属于),你不能只选择所有<input>的.
是否有一个特殊的CSS(伪?)选择器?
不,没有。
要么你用清单
input, textarea {...}
Run Code Online (Sandbox Code Playgroud)
或者您使用 css 预处理器(例如 sass)并为自己创建一个 mixin 或处理所有这些类型的函数。但在某些时候您无法回避定义所有这些元素。