Confused about CSS selector, please give me some advice_html/css_WEB-ITnose
WBOY
Release: 2016-06-24 12:22:38
Original
880 people have browsed it
CSS HTML
CSS and HTML are described as follows
The display effect is as follows:
I am confused about the selectors: input.search and #search_container input:focus
, there are no these elements in
Please give me some advice!
Reply to the discussion (solution)
input.search represents the input element of class="search" that only works. Other elements have no effect. For example,
will not have any effect
#search_container input means that all inputs in the id="search_container" element will work
input.search represents the input element of class="search" that only works. Other elements have no effect. For example,
will not have any effect
#search_container input means that all inputs in the id="search_container" element will work 1
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
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn