ID有两个的后果

css案例学习之id要唯一

<html>
<head>
<title>ID选择器</title>
<style type="text/css">
#one{
    font-weight:bold;        /* 粗体 */
    }
#two{
    font-size:30px;            /* 字体大小 */
    color:#009900;            /* 颜色 */
    }
</style>
</head>
<body>
    <p id="one">ID选择器1</p>
    <p id="two">ID选择器2</p>
    <p id="two">ID选择器3</p>
    <p id="one two">ID选择器3</p>
</body>
</html>

当id同时加入两个样式时,无效

 

相关文章:

  • 2021-06-17
  • 2021-11-08
  • 2022-12-23
  • 2022-02-21
  • 2022-12-23
  • 2021-12-12
  • 2021-10-12
  • 2021-11-21
猜你喜欢
  • 2022-12-23
  • 2021-11-21
  • 2021-08-05
  • 2021-05-19
  • 2021-12-24
  • 2021-09-11
  • 2021-11-16
相关资源
相似解决方案