We saw some basic CSS selectors in earlier recipes. In this recipe, we will explore some advanced CSS selectors for locating elements.
In the Locating elements using CSS selectors recipe, we explored some basic CSS selectors. Let's explore advanced CSS selectors such as adjacent sibling combinators and pseudo-classes as described in the following sections.
Finding child elements
CSS selectors provide various ways to locate child elements from parent elements.
For example, to locate the Username Field in the login form, we can use the following selector. Here,
> is used denote the parent ...