🏠 Home / Hub
🎨 CSS Lesson 03 — Typography
← Back to CSS Menu | 🏠 Hub
1. font-family
font-family: Arial, sans-serif;
font-family: 'Times New Roman', serif;
font-family: 'Fira Code', monospace; /* Google Font */
/* fallback list — ပထမ မရရင် ဒုတိယ သုံး */
Hello Myanmar! Arial, sans-serif
Hello Myanmar! Times New Roman, serif
Hello Myanmar! Roboto (Google Font)
Hello Myanmar! Playfair Display
Hello Myanmar! Fira Code (monospace)
2. font-size — px, em, rem
font-size: 16px; /* absolute — fixed pixel */
font-size: 1em; /* relative to PARENT font-size */
font-size: 1rem; /* relative to ROOT (html) font-size ✅ best */
font-size: 120%; /* percentage of parent */
font-size: 1.5vw; /* viewport width */
12px — smallfont-size: 12px
16px — basefont-size: 16px
20px — largefont-size: 20px
28px — XLfont-size: 28px
1rem = 16px (root default) font-size: 1rem
1.5rem = 24px font-size: 1.5rem
Parent is 20px
1em = 20px (inherits parent) 1em
1rem = 16px (root, not parent) 1rem
3. font-weight
font-weight: normal; /* 400 */
font-weight: bold; /* 700 */
font-weight: 100; /* Thin */
font-weight: 300; /* Light */
font-weight: 900; /* Black */
Weight 100 Thin font-weight: 100
Weight 300 Light font-weight: 300
Weight 400 Normal font-weight: 400
Weight 600 Semi font-weight: 600
Weight 700 Bold font-weight: 700
Weight 900 Black font-weight: 900
4. line-height & letter-spacing
line-height: 1; /* tight */
line-height: 1.5; /* comfortable ✅ recommended */
line-height: 2; /* double space */
letter-spacing: -1px; /* tight letters */
letter-spacing: 2px; /* wide letters */
letter-spacing: 5px; /* very spaced */
line-height: 1 — ကျဉ်းသည် ဖတ်ရခက်တယ် reading မကောင်း
line-height: 1
line-height: 1.6 — ဒီလောက်ဆိုရင် ဖတ်ရလွယ်တယ် readable content
line-height: 1.6 ✅
line-height: 2.2 — ကျဲသည် poetry or headings
line-height: 2.2
Letter -1px tight letter-spacing: -1px
Normal 0 letter-spacing: 0
Spaced 3px letter-spacing: 3px
HEADING letter-spacing: 6px
5. text-align, text-decoration, text-transform
text-align: left | center | right | justify
text-decoration: none; /* link underline ဖယ် */
text-decoration: underline;
text-decoration: line-through; /* strikethrough */
text-decoration: underline dotted red;
text-transform: uppercase;
text-transform: lowercase;
text-transform: capitalize; /* First Letter */
Left aligned texttext-align: left
Center alignedtext-align: center
Right alignedtext-align: right
Justify aligned — this text is long enough to show justify effect on both sidestext-align: justify
Underline texttext-decoration: underline
Strike throughline-through
Dotted red underlineunderline dotted red
hello worlduppercase
HELLO WORLDlowercase
hello worldcapitalize
6. text-shadow
text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
/* x y blur color */
/* Multiple shadows */
text-shadow: 1px 1px 0 #fff, 2px 2px 4px rgba(0,0,0,0.5);
Shadow2px 2px 4px rgba(0,0,0,0.3)
Glow0 0 10px #42b883 (glow)
Outlinemultiple shadows = outline
Hard shadow0 blur = hard shadow
7. Live Typography Playground
← CSS 02 |
Next: CSS Lesson 04 → Colors & Backgrounds
📌 Study Checklist
- အပေါ်က concept ကို တစ်ကြောင်းချင်းဖတ်ပြီး example ကို ကိုယ်တိုင်ပြန်ရေးကြည့်ပါ။
- Code/command ပါတဲ့ lesson ဆိုရင် value/name/path တစ်ခုခု ပြောင်းပြီး result ဘာကွာလဲ စမ်းပါ။
- မမှတ်မိသေးတဲ့ keyword 3 ခုကို notebook ထဲရေးပြီး နောက် lesson မသွားခင် ပြန်ရှင်းကြည့်ပါ။
- ပြီးရင် Home / Hub ကိုပြန်သွားပြီး next lesson ဆက်သင်ပါ။