How to use in css: not () applies / cancels applying borders on menus
Editor to share with you how to use css: not () on the menu to apply / cancel the application frame, I believe that most people do not understand, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!
Use: not () to apply / unapply borders on menus
Add a border to each menu item first
/ * add border * / .nav li {border-right: 1px solid # 666;}
And then remove the last element.
/ / remove border /. Nav li:last-child {border-right: none;}
You can directly use the: not () pseudo class to apply the element:
.nav li:not (: last-child) {border-right: 1px solid # 666;}
This makes the code clean, easy to read, and easy to understand.
Of course, if your new element has a sibling element, you can also use the general sibling selector (~):
Nav li:first-child ~ li {border-left: 1px solid # 666;} above is all the content of the article "how to use css: not () applies / removes applying borders on menus". 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!