P:nth-child (2)
To satisfy two conditions, 1: The second child element of the parent element of the P element is selected
2: The second child element of the selection must be a P element and will not be displayed if it is not satisfied
P:nth-of-type (2)
Select the second P element under a parent element
Talk about Nth-child (an+b).
Nth-child () This thing, is a pseudo class selector in the CSS3, jquery is also used.
There is one such translation in the "JQuery Basics Tutorial" of the domestic translation textbook. Thus the CSS
One, the code
Second, the preview effectFor example, IE9 and above background color can displayProblem: For example, IE8 background color is not displayed.Third, the solution
Iv. CSS Other selectors: Nth-of-type () selector--Selector matches each element of the
CSS3: nth-child () pseudo class selector
The power of CSS3 is amazing, and people have to feel pity for its difficult path. Good standards can only be regarded as "standard" if they receive good support from industry browsers ". CSS3 standards have been proposed for several years, but currently there are not many browsers that can implement her. Although some bro
The example in this article describes jquery: Nth-child selector usage. Share to everyone for your reference. The specific analysis is as follows:
This selector matches the nth child or parity element under its parent element.: T
The power of CSS3 is amazing, and people have to feel pity for its difficult path. Good standards can only be regarded as "standard" if they receive good support from industry browsers ". CSS3 standards have been proposed for several years, but currently there are not many browsers that can implement her. Although some browsers can implement some standards, what is the use of such standards? In the face of more compatibility issues, CSSer can only sigh. Even so, how can we stop looking forward?
Css3:nth-child () Pseudo class selectorCSS3 's strong, amazing, people in the surprise, but also have to for its difficult road feel pity: good standards only by the industry browser good support is considered "standard". CSS3 Standard has been proposed for several years, but currently can achieve her browser is not many, although some browsers can implement some of the specifications, but what is the use o
The emergence of CSS3 has undoubtedly brought great advantages to the front-end developers, today we highlight a new emergence of the powerful pseudo-class selector CSS3: Nth:child (); For the sake of understanding, I will show you the project page that I have done today. So that we can intuitively and clearly understand the function and use of this pseudo-class selector
1. First of all, we understand th
Table table odd even rows define style:CSS3 's strong, amazing, people in the surprise, but also have to for its difficult road feel pity: good standards only by the industry browser good support is considered "standard". CSS3 Standard has been proposed for several years, but currently can achieve her browser is not many, although some browsers can implement some of the specifications, but what is the use of it? Faced with more compatibility issues, Csser are only expected to sigh. Even so, how
Turn to self-love design original link http://www.dangshopex.com/jishufenxiang/WEBkaifajishu/8653.htmlCSS3 's strong, amazing, people in the surprise, but also have to for its difficult road feel pity: good standards only by the industry browser good support is considered "standard". CSS3 Standard has been proposed for several years, but currently can achieve her browser is not many, although some browsers can implement some of the specifications, but what is the use of it? Faced with more compa
CSS3 's strong, amazing, people in the surprise, but also have to for its difficult road feel pity: good standards only by the industry browser good support is considered "standard". CSS3 Standard has been proposed for several years, but currently can achieve her browser is not many, although some browsers can implement some of the specifications, but what is the use of it? Faced with more compatibility issues, Csser are only expected to sigh. Even so, how can we stop before we are forward-looki
InstanceSpecifies the background color of each p that belongs to the second child element of its parent element:p:nth-child(2){background: #ff0000;}Try it yourself.Browser support
IE
Firefox
Chrome
Safari
Opera
All major browsers support: Nth-
Review and consolidate the use of CSS3 's Nth-child (). 2015-10-201 definitions on the world of:: The Nth-child (n) selector matches the nth child element that belongs to its parent ele
Structural pseudo-Class selector-nth-child (n)": Nth-child (N)" The selector is used to locate one or more specific child elements of a parent element . where "n" is its argument and ca
Pseudo-Class selector that represents the child element under which it is matched: Nth-child (n) indicates that from the nth child element, the "n" represents the number of words that were added by the beginning of the 0.:
: The Nth-child (n) selector matches the nth child element that belongs to its parent element, regardless of the type of the element.n can be a number, a keyword, or a formula.DOCTYPE HTML>HTML>Head>style>p:nth-child (1){backgroun
Using this selector via online consulting is easy to solve. I hereby record.
Here's the main code
JS script:
Copy Code code as follows:
HTML code:
Copy Code code as follows:
The specific usage here is not written, we can refer to
Http://www.jb51.net/css/28294.html
Http://www.jb51.net/article/23617.htm
The effect chart is as follows:
Select the number of child elements under the parent element of the specified type (p):Instance:[jquery selector: Nth-of-type ()] Select the number of child elements under the parent element of the specified type (p)
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.