HTML How to Make a Website Adding Pages to a Website Add Iconography

Pranav Mathur
Pranav Mathur
3,419 Points

What if instead of specifying the whole path, " .contact-info li.phone a {}". I just use this, " .phone a {}"?

Would I be wrong if I just use, " .phone a {}" as my selector?

1 Answer

Cory Harkins
Cory Harkins
15,686 Points

You can do that.

The complexity of your selectors are dictated upon your intended targets, if you have 2 phone lists one for in-country numbers, and another for say out of country numbers, perhaps you wouldn't want to target all classes of phone, and the anchor elements within.

in your selector it will select all anchor elements within an element of the class .phone. So that's pretty broad.

Perhaps you have contact-info for your companies employees and within you have a class of .phone for the li's, and then you have a sister companies contact-info that you want to ensure is different but has a class of .phone for the li's as well.

Hope that helps to give an instance of use.