Get the App
SLTechnology News&Howtos  ›  Development  › 

How css uses the: not () selector to determine whether the form displays borders

Shulou Source: shulou.com Published: 2022-06-01 06:08:50 09月29日 Update

This article mainly shows you the "css how to use: not () selector to determine whether the form displays the border", the content is easy to understand, well-organized, hope to help you solve your doubts, the following let the editor lead you to study and learn "how to use css: not () selector to determine whether the form shows the border" this article.

Use the: not () selector to determine whether the form displays borders

Add a border to the element first

/ * add a border * / .nav li {border-right: 1px solid # 666;}

Remove the border for the last element

/ * remove the border * / .nav li:last-child {border-right: none;}

But don't do this, use the: not () pseudo class to achieve the same effect:

.nav li:not (: last-child) {border-right: 1px solid # 666;}

Of course, you can also use .nav li + li, but: not () is clearer and readable.

This is all about the article "how css uses the not () selector to decide whether the form displays borders or not. Thank you for reading!" I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Tags: Borders forms selections content articles elements learning help readability effects understandability more organization knowledge editing industry information information channels channels research Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Microsoft Xiaomi Huawei OPPO Reno Shulou Information