CSS pseudo-class selector

1 :not

The target CSS pseudo-class represents a unique page element (the target element) whose ID matches the current URL fragment
Copy the code

/* Select an element whose ID matches the current URL fragment */

:target {   border: 2px solid black;    }Copy the code

For example, the following URL has a fragment (identified with #) that points to a page element with ID section2:

http://www.example.com/index.html#section2

If the current URL is equal to the above URL, the following elements can be selected using the :target selector:

<section id="section2">Example</section>Copy the code

Input [type=” radio”]+label[for] input[type=” radio”]+label[for]

2: pseudo-element before after content value

<h1 data-text="It 's loading...">It's loading... Copy the code

h1:before { content: attr(data-text); // Before element content is It's loading... }Copy the code

Code warehouse


Summary unfinished, continue to supplement tomorrow