Computer >> คอมพิวเตอร์ >  >> การเขียนโปรแกรม >> CSS

บทบาทของ CSS [แอตทริบิวต์=ค่า] Selector


ใช้ตัวเลือก [attribute=”value”] เพื่อเลือกองค์ประกอบที่มีแอตทริบิวต์และค่าที่ระบุ

คุณสามารถลองเรียกใช้โค้ดต่อไปนี้เพื่อใช้ตัวเลือก CSS [attribute="value"] ในที่นี้ เราได้พิจารณาแอตทริบิวต์เป็น rel

ตัวอย่าง

<!DOCTYPE html>
<html>
   <head>
      <style>
         a[rel = nofollow] {
            border: 3px solid orange;
         }
      </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>