Home >Web Front-end >HTML Tutorial >Confused about CSS selector, please give me some advice_html/css_WEB-ITnose
CSS HTML
CSS and HTML are described as follows input.search
represents the input element of class="search" that only works. Other elements have no effect. For example,
input.search
represents the input element of class="search" that only works. Other elements have no effect. For example,
input.search refers to all input class controls with class "search"
#search_container input:focus
There is indeed no ID of #search_container in the code you gave. This is to find Element by ID.
input:focus pseudo-selector, when the input control is the current focus
Taken together, it is the style of the Input at any position within the element with the ID #search_container when it is focused
Refer to W3C http://www.w3.org/TR/2011/REC-CSS2-20110607 /selector.html