Detailed explanation of writing multiple conditions of CSS: not

Detailed explanation of writing multiple conditions of CSS: not

The :not pseudo-class selector can filter elements that do not match the expression

example

table tbody tr:not(:first-child):not(:last-child) td
{
     text-align: right;
}

The above code can select the non-first and non-last tr in the tbody part of the table, and set the text style of its child td element to the right

Here we need to pay attention to the grammatical format of not:

Single not writing:

/*Select non-paragraph elements*/
:not(p)
{
 
}

How to write multiple not

/*Select the middle p element in the div that is neither the first nor the last*/
div p:not(:first-child):not(:last-child){
}

The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM.

<<:  Design theory: the basics of font design

>>:  Summary of MySQL logical backup and recovery testing

Recommend

How to set up virtual directories and configure virtual paths in Tomcat 7.0

Tomcat7.0 sets virtual directory (1) Currently, o...

How to display div on object without being blocked by object animation

Today I made a menu button. When you move the mous...

js to achieve interesting countdown effect

js interesting countdown case, for your reference...

Tutorial on resetting the root password of Mac MySQL

Disclaimer: This password reset method can direct...

Nested display implementation of vue router-view

Table of contents 1. Routing Configuration 2. Vue...

Vue project implements graphic verification code

This article example shares the specific code of ...

MYSQL master-slave replication knowledge points summary

An optimization solution when a single MYSQL serv...

How to solve the problem that Seata cannot use MySQL 8 version

Possible reasons: The main reason why Seata does ...

Install and build a server environment of PHP+Apache+MySQL on CentOS

Yum (full name Yellow dog Updater, Modified) is a...

Interpreting MySQL client and server protocols

Table of contents MySQL Client/Server Protocol If...

MySQL scheduled database backup operation example

This article describes the example of MySQL sched...

Summary of 10 common HBase operation and maintenance tools

Abstract: HBase comes with many operation and mai...

Shorten the page rendering time to make the page run faster

How to shorten the page rendering time on the bro...