D
D
dennis7772016-01-25 04:06:49
Design
dennis777, 2016-01-25 04:06:49

Should I use attribute selectors?

Now I'm taking a teamtreehouse course on css selectors, and they affect attribute selectors, citing
div[id="blablabla"] as an example, in fact, this is the same as #blablabla div, isn't it?
If yes, which option is preferable?
PS Well, from a lamer's point of view, it seems to me that it can be convenient for all sorts of input[type="submit"], but why write divs like that?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
DevMan, 2016-01-25
@dennis777

IMHO, the attribute selector should only be used when there is no other way.
https://developer.mozilla.org/en-US/docs/Web/Guide...
https://benfrain.com/css-performance-revisited-sel...
https://css-tricks.com/ efficiently-rendering-css/
https://smacss.com/book/selectors

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question