Attribute ၏တန်ဖိုးအစနှင့် ကိုက်ညီသော selector

Attribute ၏တန်ဖိုးအစနှင့် ကိုက်ညီသော selector သည် tag ၏ attribute တန်ဖိုးသည် သတ်မှတ်ထားသော စာသားဖြင့် စတင်သည့် element အား style သတ်မှတ်ရန် အသုံးပြုပါသည်။

ဥပမာ

<a> tag ကို ကြည့်ရအောင်။ ထို tag ၏ href attribute တန်ဖိုးသည် https ဖြင့်စပါက ၎င်းကို အနီရောင်အဖြစ် ပြောင်းလဲမည်။

html<a href="file.html">link1</a>
<a href="">link2</a>
cssa[href^="https://"] {
  color: red;
}

Результат:

ဆက်လက်လေ့လာရန်

  • Attribute selector,
    attribute ၏အမည်ဖြင့် element ကိုရှာဖွေရန်
  • Attribute selector,
    attribute ၏တန်ဖိုးဖြင့် element ကိုရှာဖွေရန်
  • Attribute selector,
    attribute တန်ဖိုး၏အဆုံးဖြင့် element ကိုရှာဖွေရန်
  • Attribute selector,
    attribute တန်ဖိုးအတွင်းရှိ စာသားဖြင့် element ကိုရှာဖွေရန်
  • Attribute selector,
    attribute တန်ဖိုးများအနက်မှ တစ်ခုဖြင့် element ကိုရှာဖွေရန်
  • Attribute selector,
    attribute တန်ဖိုးအတွင်းရှိ hyphen ဖြင့် element ကိုရှာဖွေရန်
  • သားသမီး selector,
    တိုက်ရိုက်အဆင့်ဆင့်ချိတ်ဆက်မှုဖြင့် element များကို ရွေးချယ်ရန်
  • အကြောင်းအရာ selector,
    ၎င်း၏မိဘအားဖြင့် element တစ်ခုကို ရွေးချယ်ရန်
  • ကပ်လျက် selector,
    ၎င်း၏ကပ်လျက်ရှိ element အားဖြင့် element တစ်ခုကို ရွေးချယ်ရန်
  • ညီအစ်ကို selector,
    သတ်မှတ်ထားသော element ၏နောက်တွင်ရှိသော element များကို ရွေးချယ်ရန်
  • အထွေထွေ selector,
    element အားလုံးကို ရွေးချယ်ရန်