Example code for CSS pseudo-classes to modify input selection style

Example code for CSS pseudo-classes to modify input selection style

Note: This table is quoted from the W3School tutorial

Classification and function of pseudo-elements:

Let's take a look at the sample code of CSS pseudo-class to modify the input selection style. The code is as follows:

The after pseudo-class and font symbols are mainly used.

input{
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    display: inline-block;
}
input:after{
    content: "";
    font-size: 18px;
    display: inline-block;
    width: 14px;
    height: 14px;
    line-height: 14px;
    text-align: center;
    border: 1px solid #666fff;
    vertical-align: bottom;
}
input:checked:after{
    content: "\2714";
}

The effect is as follows:

This is the end of this article about using CSS pseudo-class to modify input selection style. For more relevant CSS input selection style content, please search 123WORDPRESS.COM’s previous articles or continue to browse the related articles below. I hope everyone will support 123WORDPRESS.COM in the future!

<<:  Detailed process of installing the docker plugin in IntelliJ IDEA (2018 version)

>>:  JS ES new features template string

Recommend

JavaScript realizes the generation and verification of random codes

The generation and verification of random codes i...

Markup language - CSS layout

Click here to return to the 123WORDPRESS.COM HTML ...

Windows Server 2019 Install (Graphical Tutorial)

Windows Server 2019 is the latest server operatin...

Detailed explanation of triangle drawing and clever application examples in CSS

lead Some common triangles on web pages can be dr...

CSS to achieve fast and cool shaking animation effect

1. Introduction to Animate.css Animate.css is a r...

Analysis of the methods of visual structure layout design for children's websites

1. Warm and gentle Related address: http://www.web...

11 Examples of Advanced Usage of Input Elements in Web Forms

1. Cancel the dotted box when the button is press...

Brief analysis of the various versions of mysql.data.dll driver

Here is the mysql driver mysql.data.dll Notice: T...

When is it appropriate to use dl, dt, and dd?

dl:Definition list Definition List dt:Definition t...

How React Hooks Work

Table of contents 1. React Hooks vs. Pure Functio...

JS realizes video barrage effect

Use ES6 modular development and observer mode to ...

How is MySQL transaction isolation achieved?

Table of contents Concurrent scenarios Write-Writ...

9 great JavaScript framework scripts for drawing charts on the web

9 great JavaScript framework scripts for drawing ...