使用 CSS 選擇帶指定屬性和值的元素


使用 [屬性 = ”值”] 選擇器選擇帶指定屬性和值的元素。

你可以嘗試執行以下程式碼來實現 CSS [屬性 = "值"] 選擇器。在此,我們已將屬性視為 rel,

示例

即時演示

<!DOCTYPE html>
<html>
   <head>
      <style>
      a[rel = nofollow] {
         border: 3px solid blue;
      }
      </style>
   </head>

   <body>
      <a href = "https://qries.com/What-is-Uber-s-business-model-and-how-does-it-compare-with-Ola-s-model-in-India" rel = "nofollow">Uber's Business Model</a><br><br>
      <a href = "https://www.qries.com/How-does-share-market-work-in-India" rel = "noreferrer">Share Market</a>
   </body>
</html>

更新於:2020 年 6 月 23 日

180 次瀏覽

啟動你的事業

完成課程可獲得認證

開始
廣告
© . All rights reserved.