CSS how to target 2 attributes?

前端 未结 3 1315
时光说笑
时光说笑 2020-12-30 23:12

OK if I want to target an tag with type=\"submit\" I can do so like:

input[type=submit]

Also if I w

相关标签:
3条回答
  • 2020-12-30 23:41

    You can use multiple attributes as follows:

    input[type=submit][value=Delete] {
        /* some rules */
    }
    
    0 讨论(0)
  • 2020-12-30 23:53
    input[type=submit][value=Delete]
    

    You're chaining selectors. Each step narrows your search results:

    input
    

    finds all inputs.

    input[type=submit]
    

    narrows it to submits, while

    input[type=submit][value=Delete]
    

    narrows it to what you need.

    0 讨论(0)
  • 2020-12-30 23:53

    You can just chain the attribute selectors

    input[type="submit"][value="delete"]
    
    0 讨论(0)
提交回复
热议问题