CSS-07: selector de identificación

La fórmula del selector de id: #definición de estilo, llamada de id de estructura, solo se puede llamar una vez, otros no deberían usarla

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>id选择器</title>
    <style>
        #pink {
      
      
            color: hotpink;
        }

        #yellow {
      
      
            color: yellow;

        }

        #green {
      
      
            color: forestgreen;
        }
    </style>
</head>

<body>
    <div id="pink">羽神说我想成为粉红色</div>
    <div id="yellow">少主说我比较好色</div>
    <div id="green">他哥表示我身上有点绿</div>
</body>

</html>

Supongo que te gusta

Origin blog.csdn.net/chuan0106/article/details/125602456
Recomendado
Clasificación