Explain how a browser determines what elements match a CSS selector.
Explain how a browser determines what elements match a CSS selector.
Share
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Aviance School is one of the largest web solutions platform in India for developers to learn and share their programming knowledge and build their careers.
The browser reads selectors from right to left so having unnecessary selectors can lead to inefficient code if the browser can determine the target element with only one specific selector it can be more efficient.
#nav ul li a { color: #F00; }
That means the browser first checks for
a
, thenli
, thenul
, and then#nav