如何在SASS中定义属性选择器? [英] How do you define attribute selectors in SASS?

查看:135
本文介绍了如何在SASS中定义属性选择器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在CSS中,可以执行此操作

  input [type = submit] {
// properties
}



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



$ p

<$>

p $ p> input
& [type =submit]
....
& [type =search]
。 ...


In CSS, you can do this:

input[type=submit] {
  // properties
}

It's a very useful for styling form buttons.

How do you do the same thing in SASS?

解决方案

You can also nest it like this

input
  &[type="submit"]
    .... 
  &[type="search"]
    .... 

这篇关于如何在SASS中定义属性选择器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆