Css: nth-of-type () selector usage, nth-of-type Selector

Source: Internet
Author: User

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 and so on are separately written in html. Now we can quickly record this good thing.

: Nth-of-type (N) The selector matches each element of the nth child element of a specific type of the parent element.NIt can be a number, a keyword, or a formula.

. Uninstall_form. uninstall_list_checkbox: nth-of-type (odd) {border-right: 1px solid # e6e6e6}
<Form onsubmit = "return check () "action =" "method =" post "name =" post_unintall "id =" post_unintall "> <div class =" uninstall_list "> <input type =" checkbox "id =" uninstall_list1 "name =" my_check [] "value =" 1 "> <label class =" uninstall_list_checkbox "> I want to download the anzhi market for a software result </label> </div> <div class = "uninstall_list"> <input type = "checkbox" id = "uninstall_list1" name = "my_check []" value = "2"> <label class = "uninstall_list_checkbox"> mobile phone problems, try uninstalling and reinstalling </label> </div> <div class = "uninstall_list"> <input type = "checkbox" id = "uninstall_list2" name = "my_check []" value = "3"> <label class = "uninstall_list_checkbox"> incomplete software, many software cannot be found </label> </div>
.....
</Form>

The right side of an odd row of the odd is a line with an even number of even rows. You can also use 2n + 1 to represent an odd number, 2n to represent an even number, and 3n + 1 to represent each of the three displays.

Similar

: Nth-child (N) The selector matches the nth child element of the parent element, regardless of the element type.NIt can be a number, a keyword, or a formula.

 

Related Article

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.