CSS में, जब आपको उन तत्वों को चुनना हो जिनका कोई एट्रिब्यूट मान किसी विशेष मान से शुरू होता है, तो आप [attribute^="value"] सेलेक्टर का उपयोग कर सकते हैं। यह सेलेक्टर उन सभी तत्वों से मेल खाता है जिनके निर्दिष्ट एट्रिब्यूट का मान दिए गए मान से शुरू होता है।
उदाहरण
नीचे दिए गए उदाहरण में, हम उन सभी <img> तत्वों को चुन रहे हैं जिनके alt एट्रिब्यूट का मान "Tutor" से शुरू होता है।
<!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>
परिणाम: पहली इमेज ("Tutor Connect") पर नीला बॉर्डर लागू होगा क्योंकि इसका alt मान "Tutor" से शुरू होता है, जबकि दूसरी इमेज ("Tutorials Library") पर कोई प्रभाव नहीं पड़ेगा।