We need to keep selectors as simple and efficient as possible.
For a or input elements, it is quite correct (using name, ids, text, etc.) but for other elements we need to produce a clean selector.
For instance, we will prefer:
.main .search
rather than
div:nth-child(5) div.main div span div.search
We need to keep selectors as simple and efficient as possible. For
a
orinput
elements, it is quite correct (using name, ids, text, etc.) but for other elements we need to produce a clean selector. For instance, we will prefer: .main .search rather than div:nth-child(5) div.main div span div.search