使用 CSS 选择特定元素,如

with CSS


要选择元素,使用元素选择器。你可以尝试运行以下代码来选择 <p> 元素

示例

实际演示

<!DOCTYPE html>
<html>
   <head>
      <style>
         p {
            color: blue;
            background-color: orange;
         }
      </style>
   </head>
   <body>
      <h1>Demo Website</h1>
      <h2>Learning</h2>
      <p>Tutorials on web dev, programming, database, networking, etc.</p>
      <p>Every tutorials has lessons with illustrations and figures.</p>
   </body>
</html>

更新日期: 2020 年 6 月 24 日

89 次阅读

开启您的 职业生涯

完成课程获取认证

开始
广告
© . All rights reserved.