CSS3 setting does not have an instance of the list spacer method on the bottom

Source: Internet
Author: User
This paper mainly introduces the use of CSS3 how to set the list spacing line without the bottom, the article shared two solutions, respectively, using the General Brotherhood selector (~) and Pseudo-class selector (: First-of-type/: Last-of-type) to achieve, Give a detailed example code for everyone to refer to the study, the following to see together. Hope to help everyone.


Method One: Universal Brotherhood selector (~)

<! DOCTYPE html>

The ~ symbol in the Li~li {...} is called the generic sibling selector, which matches the P element after the P element, so the first P element does not match.

Method Two: Pseudo-class selector (: First-of-type/: Last-of-type)

<! DOCTYPE html>

First set all Li to Border-top, then use: First-of-type to find the first Li, cancel border-top.

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.