TGViewer
Web Development Web Development @web_dev_bds · 4.43K subscribers
Post #712 535
✅ CSS Basics You Should Know 🎨💻

CSS (Cascading Style Sheets) is used to style HTML elements — adding colors, spacing, layout, and more.

1️⃣ CSS Syntax
selector {
  property: value;
}

Example:
h1 {
  color: blue;
  font-size: 32px;
}


2️⃣ How to Add CSS
⦁ Inline:
<p style="color: red;">Hello</p>

⦁ Internal (within HTML):
<style>
  p { color: green; }
</style>

⦁ External (best practice):
<link rel="stylesheet" href="style.css">


3️⃣ Selectors
⦁ * → All elements
⦁ p → All <p> tags
⦁ .class → Elements with class
⦁ #id → Element with specific ID
#title { color: blue; }.red-text { color: red; }


4️⃣ Colors & Fonts
body {
  background-color: #f2f2f2;
  color: #333;
  font-family: Arial, sans-serif;
}


5️⃣ Box Model 
Every HTML element is a box: 
content + padding + border + margin

6️⃣ Layout with Flexbox
{
  display: flex;
  justify-content: space-between;
  align-items: center;
}


7️⃣ Responsive Design
@media (max-width: 600px) {
  body {
    font-size: 14px;
  }
}


8️⃣ Hover Effects
button:hover {
  background-color: black;
  color: white;
}


9️⃣ Common Properties
⦁ color – Text color
⦁ background-color – Background
⦁ margin & padding – Spacing
⦁ border – Border style
⦁ width / height – Size
⦁ text-align – Alignment

💡 Tip: Organize your styles using class names and external CSS files for better scalability.

💬 Tap ❤️ for more!
  • 🔥 3
More from @web_dev_bds
  1. Oct 16, 2026📕Random React Tip: If you want to quickly log things from JSX (we've all been there), you…
  2. Oct 15, 2026Websites to Learn Every Technology
  3. Oct 13, 2026Docker vs Kubernetes
  4. Oct 12, 2026Post #1054
  5. Oct 11, 2026CSS Tip Stop centring tooltips with 𝚝𝚛𝚊𝚗𝚜𝚕𝚊𝚝𝚎: -𝟻𝟶%. near the edge of the scree…
  6. Oct 9, 2026JavaScript CheatSheet
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →