In jQuery: example of first-child selector usageThis selector can match the first child element of the parent element.Syntax structure:$ (": First-child ")This selector should also be used with other selectors, such as class selector and element
CSS structure pseudo Class E: first-child/last-child/only-child/empty,
E: first-child explanation: the first child element of E's parent element is exactly E. Define the style for E.
E: last-child explanation: the last sub-element of the parent
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
How does jquery get the first or last child element? Through the Children method, children ("Input:first-child")$( This). Children ("Input:first-child"). Val (); $ ( This). Children ("Input:last-child"). Val ();> Selector, $ (". Items>input:first"in
Compare the description of the pseudo-class selector in W3cschool: Last-child and: Last-of-type, as follows:: Last-child p:last-child selects each element that belongs to the last child element of its parent element. : Last-of-type
In jQuery: last-child selector usage example, jquerylast-child
This document describes the usage of the last-child selector in jQuery. Share it with you for your reference. The specific analysis is as follows:
This selector can match the last child
Structural pseudo-Class selector-nth-last-child (n)": Nth-last-child (N)" selector and the previous ": Nth-child (N)" selector is very similar, but here is a "last", the role of the ": Nth-child (n)" selector differs, Select a specific element by
I was curious about a small problem I found when I was tossing the topic.First, we will introduce the first-child pseudo class, that is, selecting the first object.For example: Test Test Test In css, you can use. loop: first-child to define a
: First-child looks for the first child element of the parent element, sorted in all child elements;
: Last-child looks for the last child element of the parent element, sorted in all child elements;
: Nth-child the child elements of the
CSS3 provides a powerful pseudo-class selector, allowing developers to select elements that meet specific conditions in an object for rendering. These pseudo classes will be very confusing when you are new to them, but after you have mastered them,
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.