Attribute Value Matching
Beyond exact matches, attribute selectors support powerful pattern matching.
Starts With (^=)
Select attributes that start with a value:
Loading Selector Playground...
[href^="https"]- links starting with "https"[href^="#"]- anchor links[href^="/"]- relative paths
Ends With ($=)
Select attributes that end with a value:
Loading Selector Playground...
[href$=".pdf"]- PDF links[href$=".jpg"]- JPG images[src$=".png"]- PNG images
Contains (*=)
Select attributes containing a value anywhere:
Loading Selector Playground...
[href*="google"] - links containing "google" anywhere
Styling File Links
Loading CSS Playground...
Word Match (~=)
Matches a whole word in a space-separated list:
Loading Selector Playground...
[class~="featured"] matches "featured" as a complete word.
External Link Indicator
Loading CSS Playground...
Exercise: Style Image Links
Style links to images differently:
Loading CSS Exercise...
التالي · الدرس 10 من 27
Hover and Focus States
قراءة 2 دقيقة
أنهيت 9 من 27 درسًا

اسأل Byte عن هذا الدرس
محادثة خاصة حول هذا الدرس. قرأ Byte الدرس كاملًا، ويجيب خلال ثوانٍ، ويُظهر القسم الذي تأتي منه كل إجابة. يمكنك السؤال بأي لغة.
الأسئلة والأجوبة
أسئلة عامة حول هذا الدرس. يجيب AI Tutor فورًا بلغتك، ويراجع فريق FreeAcademy الإجابات، ويمكن لكل المتعلمين قراءتها.

