使用[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 選擇具有指定屬性和值的元素的詳細內容,更多請關注www.92cms.cn其它相關文章!