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

A brief introduction to web2.0 products and functions

<br />What is web2.0? Web2.0 includes those ...

css Get all elements starting from the nth one

The specific code is as follows: <div id="...

How to use Tencent slider verification code in Vue3+Vue-cli4 project

Introduction: Compared with traditional image ver...

CSS to achieve zoom in and out close button (example code)

This effect is most common on our browser page. L...

Three ways to avoid duplicate insertion of data in MySql

Preface In the case of primary key conflict or un...

The latest mysql-5.7.21 installation and configuration method

1. Unzip the downloaded MySQL compressed package ...

Ubuntu View and modify mysql login name and password, install phpmyadmin

After installing MySQL, enter mysql -u root -p in...

How to verify whether MySQL is installed successfully

After MySQL is installed, you can verify whether ...

Solution to the bug that IE6 select cannot be covered by div

Use div to create a mask or simulate a pop-up wind...

A detailed account of the process of climbing a pit of Docker deployment service

First time writing. Allow me to introduce myself....

11 Reasons Why Bootstrap Is So Popular

Preface Bootstrap, the most popular front-end dev...

Differences between ES6 inheritance and ES5 inheritance in js

Table of contents Inheritance ES5 prototype inher...

Play with the connect function with timeout in Linux

In the previous article, we played with timeouts ...