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

เลือกองค์ประกอบที่ค่าแอตทริบิวต์ขึ้นต้นด้วยค่าที่ระบุด้วย CSS

หากต้องการเลือกองค์ประกอบที่ค่าแอตทริบิวต์ขึ้นต้นด้วยค่าที่กำหนด ให้ใช้เซเล็กเตอร์ [attribute^="value"]

ตัวอย่าง

<!DOCTYPE html> <html>    <head>       <style>          [alt^=Tutor] {             border: 5px solid blue;             border-radius: 5px;          }       </style>    </head>    <body>       <img src = "https://www.tutorialspoint.com/videotutorials/images/tutor_connect_home.jpg" height="200" width="200" alt="Tutor Connect">       <img src = "https://www.tutorialspoint.com/videotutorials/images/tutorial_library_home.jpg" height="200" width="200" alt="Tutorials Library">    </body> </html>