CSS ကျူတိုရီရယ်

CSS ပင်မစာမျက်နှာ CSS နိဒါန်း CSS Syntax CSS ရွေးချယ်မှုများ CSS လုပ်နည်း CSS မှတ်ချက်များ CSS အရောင်များ CSS နောက်ခံများ CSS နယ်နိမိတ်များ CSS အနားသတ်များ CSS Padding CSS အမြင့်/အနံ CSS Box မော်ဒယ် CSS အကြမ်းဖျင်း CSS စာသား CSS ဖောင့်များ CSS အိုင်ကွန်များ CSS လင့်ခ်များ CSS စာရင်းများ CSS ဇယားများ CSS Display CSS Max-အကျယ် CSS ရာထူး CSS Z အညွှန်း CSS Overflow CSS Float CSS Inline-block CSS ကို ချိန်ညှိပါ။ CSS Combinators CSS Pseudo-class CSS Pseudo-ဒြပ်စင် CSS Opacity CSS Navigation Bar CSS Dropdowns CSS ရုပ်ပုံပြခန်း CSS Image Sprites CSS Attr ရွေးချယ်မှုများ CSS ပုံစံများ CSS ကောင်တာများ CSS ဝဘ်ဆိုဒ် အပြင်အဆင် CSS ယူနစ်များ CSS တိကျမှု CSS !အရေးကြီးသည်။ CSS သင်္ချာလုပ်ဆောင်ချက်များ

CSS အဆင့်မြင့်

CSS Rounded Corners CSS Border ပုံများ CSS နောက်ခံများ CSS အရောင်များ CSS အရောင်သော့ချက်စာလုံးများ CSS Gradients CSS Shadows CSS စာသားအကျိုးသက်ရောက်မှုများ CSS ဝဘ်ဖောင့်များ CSS 2D အသွင်ပြောင်းမှုများ CSS 3D အသွင်ပြောင်းမှုများ CSS အသွင်ကူးပြောင်းမှုများ CSS Animations CSS Tooltips CSS စတိုင်ပုံများ CSS Image Reflection CSS object-fit CSS object-position CSS Masking CSS ခလုတ်များ CSS Pagination CSS ကော်လံမျိုးစုံ CSS User Interface CSS အပြောင်းအလဲများ CSS Box Sizing CSS မီဒီယာမေးခွန်းများ CSS MQ နမူနာများ CSS Flexbox

CSS တုံ့ပြန်မှု

RWD မိတ်ဆက် RWD Viewport RWD Grid View RWD မီဒီယာမေးခွန်းများ RWD ပုံများ RWD ဗီဒီယိုများ RWD မူဘောင်များ RWD နမူနာများ

CSS Grid

Grid Intro ဂရစ်ကွန်တိန်နာ ဇယားကွက်

CSS SASS

SASS ကျူတိုရီရယ်

CSS နမူနာများ

CSS Templates များ CSS နမူနာများ css စာမေးပွဲ CSS လေ့ကျင့်ခန်းများ CSS လက်မှတ်

CSS ကိုးကားချက်များ

CSS အကိုးအကား CSS ရွေးချယ်မှုများ CSS လုပ်ဆောင်ချက်များ CSS အကိုးအကား Aural CSS ဝဘ်ဘေးကင်းသောဖောင့်များ CSS Animatable CSS ယူနစ်များ CSS PX-EM Converter CSS အရောင်များ CSS အရောင်တန်ဖိုးများ CSS မူရင်းတန်ဖိုးများ CSS Browser ပံ့ပိုးမှု

CSS Pseudo-classes


Pseudo-classes ဆိုတာ ဘာလဲ။

ဒြပ်စင်တစ်ခု၏ အထူးအခြေအနေတစ်ခုကို သတ်မှတ်ရန် pseudo-class ကိုအသုံးပြုသည်။

ဥပမာအားဖြင့်၊ ၎င်းကိုအသုံးပြုနိုင်သည်-

  • အသုံးပြုသူတစ်ဦးက ၎င်းကို မောက်စ်တင်သည့်အခါ အစိတ်အပိုင်းတစ်ခု ပုံစံဖန်တီးပါ။
  • လည်ပတ်ခဲ့သည့်ပုံစံနှင့် မလည်ပတ်ရသေးသောလင့်ခ်များ မတူညီပါ။
  • အာရုံစူးစိုက်မှုရလာသောအခါတွင် အစိတ်အပိုင်းတစ်ခုကို ပုံစံသွင်းပါ။

Mouse Over Me


အထားအသို

pseudo-classes ၏ syntax

selector:pseudo-class {
  property: value;
}

Anchor Pseudo-classes

လင့်ခ်များကို ပုံစံအမျိုးမျိုးဖြင့် ပြသနိုင်သည်-

ဥပမာ

/* unvisited link */
a:link {
  color: #FF0000;
}

/* visited link */
a:visited {
  color: #00FF00;
}

/* mouse over link */
a:hover {
  color: #FF00FF;
}

/* selected link */
a:active {
  color: #0000FF;
}

မှတ်ချက်- ထိရောက်စေရန်အတွက် CSS ၏ အဓိပ္ပါယ်ဖွင့်ဆိုချက်တွင် ပါ a:hoverရှိရမည် a:linkထိရောက်မှုရှိစေရန်အတွက် CSS ၏ အဓိပ္ပါယ်ဖွင့်ဆိုချက်တွင် ပါဝင်ရမည် Pseudo-class အမည်များသည် စာလုံးအကြီးအသေး အာရုံမခံပါ။a:visiteda:activea:hover



Pseudo-classes နှင့် HTML Classes များ

Pseudo-class များကို HTML အတန်းများနှင့် ပေါင်းစပ်နိုင်သည်။

ဥပမာရှိ လင့်ခ်ကို နှိပ်လိုက်သောအခါ၊ ၎င်းသည် အရောင်ပြောင်းသွားလိမ့်မည်-

ဥပမာ

a.highlight:hover {
  color: #ff0000;
}

<div> ပေါ်တွင် ရွှေ့ပါ။

:hover<div> ဒြပ်စင်တစ်ခုပေါ်တွင် pseudo-class ကိုအသုံးပြုခြင်း၏ဥပမာ တစ်ခု။

ဥပမာ

div:hover {
  background-color: blue;
}


ရိုးရှင်းသော Tooltip ကို Hover

<p> ဒြပ်စင်ကိုပြသရန် (ကိရိယာအကြံပြုချက်ကဲ့သို့)

<p> ဒြပ်စင်ကိုပြသရန် ကျွန်ုပ်၏အပေါ်၌ မောက်စ်ပေါ်တင်ပါ။

Tada! Here I am!

ဥပမာ

p {
  display: none;
  background-color: yellow;
  padding: 20px;
}

div:hover p {
  display: block;
}


CSS - :first-child Pseudo-class

pseudo-class သည် :first-childအခြားဒြပ်စင်တစ်ခု၏ ပထမကလေးဖြစ်သည့် သတ်မှတ်ထားသော ဒြပ်စင်နှင့် ကိုက်ညီပါသည်။

ပထမ <p> ဒြပ်စင်နှင့် ကိုက်ညီပါ။

အောက်ဖော်ပြပါ ဥပမာတွင်၊ ရွေးချယ်သူသည် မည်သည့်ဒြပ်စင်၏ ပထမကလေးဖြစ်သည့် <p> ဒြပ်စင်နှင့် ကိုက်ညီသည်-

ဥပမာ

p:first-child {
  color: blue;
}

<p> ဒြပ်စင်အားလုံးရှိ ပထမ <i> ဒြပ်စင်ကို ယှဉ်ပါ။

အောက်ပါဥပမာတွင်၊ ရွေးချယ်သူသည် <p> ဒြပ်စင်များအားလုံးရှိ ပထမ <i> ဒြပ်စင်နှင့် ကိုက်ညီသည်-

ဥပမာ

p i:first-child {
  color: blue;
}

ပထမကလေး <p> ဒြပ်စင်များအားလုံးရှိ <i> ဒြပ်စင်အားလုံးကို ယှဉ်ပါ။

အောက်ဖော်ပြပါ ဥပမာတွင်၊ ရွေးချယ်သူသည် အခြားဒြပ်စင်တစ်ခု၏ ပထမကလေးဖြစ်သော <p> ဒြပ်စင်များရှိ <i> ဒြပ်စင်များအားလုံးနှင့် ကိုက်ညီသည်-

ဥပမာ

p:first-child i {
  color: blue;
}

CSS - :lang Pseudo-class

:langpseudo-class သည် သင့်အား မတူညီသောဘာသာစကားများအတွက် အထူးစည်းမျဉ်းများကို သတ်မှတ်ခွင့်ပြုသည်

အောက်ပါဥပမာတွင်၊ :langlang="no" ဖြင့် <q> ဒြပ်စင်များအတွက် ကိုးကားအမှတ်အသားများကို သတ်မှတ်သည်-

ဥပမာ

<html>
<head>
<style>
q:lang(no) {
  quotes: "~" "~";
}
</style>
</head>
<body>

<p>Some text <q lang="no">A quote in a paragraph</q> Some text.</p>

</body>
</html>

နောက်ထပ် ဥပမာများ


ဤဥပမာသည် ဟိုက်ပါလင့်ခ်များသို့ အခြားစတိုင်များကို ထည့်သွင်းနည်းကို သရုပ်ပြသည်။


ဤဥပမာသည် :focus pseudo-class ကိုအသုံးပြုပုံကို သရုပ်ပြသည်။


လေ့ကျင့်ခန်းများဖြင့် သင့်ကိုယ်သင် စမ်းသပ်ပါ။

လေ့ကျင့်ခန်း

လင့်ခ်တစ်ခုအပေါ် မောက်စ်တင်သောအခါ နောက်ခံအရောင်ကို အနီရောင်အဖြစ် သတ်မှတ်ပါ။

<style>
 {
  background-color: red;
}
</style>

<body>

<h1>This is a header.</h1>
<p>This is a paragraph.</p>
<a href="https://w3schools.com">This is a link.</a>

</body>


CSS Pseudo Classes အားလုံး

Selector Example Example description
:active a:active Selects the active link
:checked input:checked Selects every checked <input> element
:disabled input:disabled Selects every disabled <input> element
:empty p:empty Selects every <p> element that has no children
:enabled input:enabled Selects every enabled <input> element
:first-child p:first-child Selects every <p> elements that is the first child of its parent
:first-of-type p:first-of-type Selects every <p> element that is the first <p> element of its parent
:focus input:focus Selects the <input> element that has focus
:hover a:hover Selects links on mouse over
:in-range input:in-range Selects <input> elements with a value within a specified range
:invalid input:invalid Selects all <input> elements with an invalid value
:lang(language) p:lang(it) Selects every <p> element with a lang attribute value starting with "it"
:last-child p:last-child Selects every <p> elements that is the last child of its parent
:last-of-type p:last-of-type Selects every <p> element that is the last <p> element of its parent
:link a:link Selects all unvisited links
:not(selector) :not(p) Selects every element that is not a <p> element
:nth-child(n) p:nth-child(2) Selects every <p> element that is the second child of its parent
:nth-last-child(n) p:nth-last-child(2) Selects every <p> element that is the second child of its parent, counting from the last child
:nth-last-of-type(n) p:nth-last-of-type(2) Selects every <p> element that is the second <p> element of its parent, counting from the last child
:nth-of-type(n) p:nth-of-type(2) Selects every <p> element that is the second <p> element of its parent
:only-of-type p:only-of-type Selects every <p> element that is the only <p> element of its parent
:only-child p:only-child Selects every <p> element that is the only child of its parent
:optional input:optional Selects <input> elements with no "required" attribute
:out-of-range input:out-of-range Selects <input> elements with a value outside a specified range
:read-only input:read-only Selects <input> elements with a "readonly" attribute specified
:read-write input:read-write Selects <input> elements with no "readonly" attribute
:required input:required Selects <input> elements with a "required" attribute specified
:root root Selects the document's root element
:target #news:target Selects the current active #news element (clicked on a URL containing that anchor name)
:valid input:valid Selects all <input> elements with a valid value
:visited a:visited Selects all visited links

CSS Pseudo Elements အားလုံး

Selector Example Example description
::after p::after Insert content after every <p> element
::before p::before Insert content before every <p> element
::first-letter p::first-letter Selects the first letter of every <p> element
::first-line p::first-line Selects the first line of every <p> element
::selection p::selection Selects the portion of an element that is selected by a user