css - Why use an attribute selector to match classes? -


i have found an example of responsive email templates there such css selectors such following:

a[class="btn"] 

why syntax used if it's totally same as:

a.btn 

does have impact on mobile browsers or else?

the [] syntax attribute selector.

a[class="btn"] 

this select <a> tag class="btn". however, not select <a> has class="btn btn_red", example (whereas a.btn would). exactly matches attribute.

you may want read the 30 css selectors must memorize. it's invaluable up-and-coming web developer.


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -