1: Tag selector The tag selector is used for all tags. Here we take p as an example, that is, all the tags with p will have this style. Copy code The code is as follows:<html> <head> <styletype="text/css"> p{font:"宋体"; color:#FF0000} </style> </head> <body> <pid="p1">I am now showing the tag selector</p> <pid="p2">I also use the tag selector</p> <h1>I am not modified by any selector</h1> </body> </html> 2: id selector . Note that the id selector is unique, because only id="yy" has this style, and the ID of an element in a page must be unique, so. . . You know that the id selector starts with # and is used as follows: id="" Copy code The code is as follows:<html> <head> <styletype="text/css"> #yy{font:"宋体"; color:#FF0000} </style> </head> <body> <pid="yy">I am now showing the id selector</p> <pid="p">I am not modified by the id selector</p> <h1>I am not modified by any selector</h1> </body> </html> 3: Class selector . Class selectors start with . Just set the element's class="" to display this style. The usage is: class="" Copy code The code is as follows:<html> <head> <styletype="text/css"> .yy{font:"宋体"; color:#FF0000} </style> </head> <body> <pclass="yy">I am now showing the class selector</p> <pclass="yy">I am not modified by the class selector</p> <h1>I am not modified by any selector</h1> </body> </html> |
<<: Centos8.3, docker deployment springboot project actual case analysis
>>: CSS perfectly solves the problem of front-end image deformation
For work needs, I need to make a mobile phone adap...
Usage Environment In cmd mode, enter mysql --vers...
How to quickly copy a table First, create a table...
One line command docker run -d \ -v /share:/home/...
Get the current time: select current_timestamp; O...
Nginx is now one of the most popular load balance...
This article shares the specific code of NodeJS t...
Table of contents Preface Implementation ideas Ef...
Table of contents 1. Knowledge description of the...
Preface: In Vue, props can be used to connect ori...
1. Complexity of front-end engineering If we are ...
Table of contents 1. Pull the mysql image 2. Chec...
Purpose: Nested use of MySQL aggregate functions ...
Preface MySQL is a high-speed, high-performance, ...
VMware Workstation is a powerful desktop virtual ...