Nth-child is the element that selects all elements under the current parent element, while Nth-of-type represents the first element of a given type that selects a parent element.For example, select the first P element under the p parent element, so you can write:Parent>p:first-child or Parent>p:first-of-type, the first
Today, I learned about jQuery and saw the nth-child (even) usage. I specifically found the usage of this selector. In the CSS3 standard, the usage is very powerful. In this regard, I will give a general introduction to the usage of nth-child () in CSS3:
CSS3 pseudo-class
In this regard, I will give a general introduction to the usage of Nth-child () in css3:
Css3 pseudo-class selector: Nth-child ()
Briefly summarize several Nth-child () usage.
F
: The nth-child (n) selector matches the nth child element of its parent element. This article introduces the examples of using the cssnth-child selector to coders. For more information
In this respect, I put the CSS3 standard Nth-child () the use of the general introduction:
CSS3 Pseudo class selector: Nth-child ()
A simple summary of several uses of Nth-child ().
Css learning selector: nth-child (n)
Today, I learned a new small effect. For example, when a website changes the color of a line, for example, a black line or a white line, the zebra will show up. When you touch a line with your mouse, color background changes, especially when you connect to the database, simple code
One, deep breathing, direct content: Nth-child and: Nth-of-type are CSS3 in the pseudo-class selector, its role is similar but not exactly the same, for unfamiliar people may not be very different, this article will introduce the difference between the two, in order to facilitate the correct use of both types of select
Select the nth child or odd-even element that matches the parent element:Instance:inchdiv.inchDiv.inchThe div.inchAnother div.inchAnother div.[jquery selector: Nth-child] Select to match the nth
This time to bring you the selector nth-child and: Nth-of-type of the use of detailed, using the selector nth-child and: What are the considerations of
: Nth-child and: Nth-of-type are CSS3 in the pseudo-class selector, its role is similar but not exactly the same, for unfamiliar people may not be very different, this article will introduce the difference between the two, in order to facilitate the correct use of both types of selectors.Let's look at the following two
This article mainly introduces about how to use CSS properties Nth-child (n) match select Nth Sub-element, has a certain reference value, now share to everyone, the need for friends can refer to
CSS Match Select the nth
the JS page: $ ("#btn"), and then perform an event operation on it.Vii. class selector: $ (". Btn")First declare a class selector in HTML: class= "BTN", then find this ID selector in the JS page: $ (". Btn"), and then perform an event operation on it.Eight, Tag selector: $ ("tr")The tag
in HTML: id= "BTN", and then find this ID selector in the JS page: $ ("#btn"), and then perform an event operation on it.4. Class Selector: $ (". Btn")First declare a class selector in HTML: class= "BTN", then find this ID selector in the JS page: $ (". Btn"), and then perform an event operation on it.5. Tag
Then the corresponding CSS code for the 2 selectors is as follows:P:nth_child (2) {color:red;}P:nth-of-type (2) {color:red;}The two corresponding effects are the same:For: The Nth-child selector has two points to explain:1, this is a paragraph element.2, this is the second child
Indicates that the element is a label and a p:nth-child(2) p second child element , which is two conditions that must be met.So, the first p label color is red (just match: P tag, second child element). If you div insert a label after the label span , the following:Then p:nth-child(2) no elements will be selected. p:n
First,: Nth-child1.1 Description
: 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.
Note
First,: Nth-child
1.1 Description
: 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
Casual -- pseudo-class selector: The difference between nth-child (n) and nth-of-type (n !!!, Nthoftypen
Not much talk! Answer the question !!!
I. E: nth-child (n) // select the (n) element in the parent element. if the
Css: nth-of-type () selector usage, nth-of-type Selector
I made a page today and accidentally saw thisnth-of-typeIt is quite convenient. Some of the previous single and double lines have horizontal lines, and some do not have horizontal lines. Generally, border-right: none a
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.