使用[attribute = ”value”]選擇器來選擇具有指定屬性和值的元素。
您可以嘗試執行下列程式碼來實作CSS [attribute = "值」]選擇器。在這裡,我們將屬性視為rel,
Live Demo
<!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>
以上是如何使用 CSS 選擇具有指定屬性和值的元素的詳細內容。更多資訊請關注PHP中文網其他相關文章!