The following CSS class names starting with a number will not take effect: .1st{ color: red; } A valid CSS class name must start with one of the following: • Underscore_ Then followed by another _ , - , number or letter. In regular expression, a legal CSS class name is: In addition, according to the description in the CSS standard, if the class name starts with a hyphen - , the second character must be an underscore _ or a letter, but actual testing has found that in addition to the two mentioned, following another hyphen is also effective. The following are the test codes and results: <p class="1st">should apply red color</p> <p class="-1foo">should apply red color</p> <p class="-_foo">should apply red color</p> <p class="--foo">should apply red color</p> <p class="-foo">should apply red color</p> <p class="foo">should apply red color</p> .1st { color: red; } .-1foo { color: red; } .-_foo { color: red; } .--foo { color: red; } .-foo { color: red; } .foo { color: red; } Actual effects of different class names Summarize The above is a detailed explanation of the CSS class name problem introduced by the editor. I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website! |
<<: Web design must also first have a comprehensive image positioning of the website
The installation process is basically the same as...
Implementation of time comparison in MySql unix_t...
The CSS counter attribute is supported by almost ...
Payment countdown to return to the home page case...
Record the installation and configuration method ...
MySQL 5.7.20 zip installation, the specific conte...
Demand scenario: The boss asked me to use the cra...
Problem Description In the login page of the proj...
Table of contents 1. Some concepts you need to un...
Table of contents Create a new html file: Create ...
The sudo command allows a trusted user to run a p...
dig - DNS lookup utility When a domain name acces...
When setting display:flex, justify-content: space...
Today I made a Spring Festival gold coin red enve...
Therefore, we made a selection of 30 combinations ...