如何在SASS中定义属性选择器?

CSS

阿良

2020-03-18

在CSS中,您可以执行以下操作

input[type=submit] {
  // properties
}

这对于样式表单按钮非常有用。

您如何在SASS中做同样的事情?

第2092篇《如何在SASS中定义属性选择器?》来自Winter(https://github.com/aiyld/aiyld.github.io)的站点

2个回答
Green理查德 2020.03.18

您也可以这样嵌套

input
  &[type="submit"]
    .... 
  &[type="search"]
    .... 
阿良 2020.03.18

该转换器网站说:

input[type=submit]
  // properties

问题类别

JavaScript Ckeditor Python Webpack TypeScript Vue.js React.js ExpressJS KoaJS CSS Node.js HTML Django 单元测试 PHP Asp.net jQuery Bootstrap IOS Android