使用 CSS 选择 id="tutorials" 的元素

cssweb developmentfront end technology更新于 2024/7/23 2:20:17

要选择所有 id=”tutorials” 的元素,您可以尝试运行以下代码。

使用 #id CSS 选择器实现此目的

示例

<!DOCTYPE html>
<html>
   <head>
      <style>
         #tutorials {
            border: 3px solid red;
         }
      </style>
   </head>
   <body>
      <h1>Tutorialspoint</h1>
      <h2>Learning</h2>
      <p id = "tutorials">Tutorials on web dev, programming, database, networking, etc.</p>
      <p>Every tutorials has lessons with illustrations and figures.</p>
   </body>
</html>

相关文章


有用资源