ID selector (CSS selectors)

ID selector pound sign prefix followed by the ID name.

Id attribute defined in the tag, then the attribute value is set inside the ID name.

<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <link rel="stylesheet" type="text/css" href="../css/index.css" />
    </head>
    <body>
     <div  id="IDxuanzeqi">
         
     </div>
    </body>
</html>

The following is written in CSS style file index.css

#IDxuanzeqi{

width:100px;
height:100px;
background-color;red;



}

2019-08-24 10:18:43

Guess you like

Origin www.cnblogs.com/qf928/p/11403739.html