luqita
luqita

Reputation: 4077

Specificity for input[type="text"]

How can I add specifity to something that reads:

input[type="text"] { color:red }

I want something like:

#my_id input[type="text"] { color:red }

Upvotes: 0

Views: 242

Answers (2)

rekire
rekire

Reputation: 47945

When you use an id and don't want to address a child node you can omit any other parts, a id must be unique so far you can use just:

#my_id { color:red }

Upvotes: 1

Kermit
Kermit

Reputation: 34055

You mean like this?

input[type="text"]#my_id { color:red }

See the demo

Upvotes: 4

Related Questions