CSS style id selector cannot use all numbers

** Wrong way of writing: If the id writes a number, the browser cannot parse it out, and it will not be able to output the style **

 <style type="text/css">

        #1001{
     
     
            font-size: smaller;
            color: red;
            border: aqua solid 1px;

        }
    </style>
</head>
<body>

<div id="1001" >标签1aa</div>

Correct way of writing:


<!--    注意此时的id 不能使用全数字进行选择-->
    <style type="text/css">

        #id1001{
     
     
            font-size: smaller;
            color: red;
            border: aqua solid 1px;

        }
    </style>
</head>
<body>

<div id="id1001" >标签1aa</div>


Guess you like

Origin blog.csdn.net/weixin_46351306/article/details/114686560