`). | Set the initial color of links. |
+| `:checked` | A radio button or checkbox is selected. | Style a checkbox label when the box is checked. |
+
+### Example: Styling a Button State
+
+```css title="styles.css"
+/* Base style for the button */
+.my-button {
+ background-color: #3498db;
+ color: white;
+ padding: 10px 20px;
+ transition: background-color 0.3s; /* Smooth visual change */
+}
+
+/* Style when the user hovers over the button */
+.my-button:hover {
+ background-color: #2980b9; /* Slightly darker */
+}
+
+/* Style when the user is actively clicking the button */
+.my-button:active {
+ background-color: #e74c3c; /* Red color flash */
+}
+```
+
+
+
+
+## Structural Pseudo-Classes (Position)
+
+These selectors target elements based on their placement or numerical order within a parent container.
+
+### Simple Position Selectors
+
+These are useful for targeting the beginning or end of a sequence of elements.
+
+| Selector | Description | Example Use Case |
+| :--- | :--- | :--- |
+| `:first-child` | Selects the element if it is the very first child of its parent. | Remove the top margin from the first paragraph in a container. |
+| `:last-child` | Selects the element if it is the very last child of its parent. | Remove the bottom border from the last item in a list. |
+| `:only-child` | Selects the element if it is the sole child of its parent. | Center a menu only if it has just one link. |
+
+### The `nth` Selectors
+
+The `nth-child()` and `nth-of-type()` pseudo-classes are extremely powerful as they accept an argument to create complex patterns.
+
+| Selector | Argument | Description |
+| :--- | :--- | :--- |
+| `:nth-child(n)` | `odd`, `even`, `2n`, `3n+1` | Selects elements based on their position among **all siblings**, regardless of tag type. |
+| `:nth-of-type(n)` | `odd`, `even`, `2n` | Selects elements based on their position among **siblings of the same type (tag)**. |
+
+:::tip `nth-child` vs. `nth-of-type`
+Use **`:nth-of-type()`** when you want to style every other element of the *same tag* (e.g., alternating colors for table rows, `tr:nth-of-type(odd)`).
+Use **`:nth-child()`** when the element must be in a specific numerical position relative to *all* children, even if they are different tags.
+:::
+
+## Specificity Score
+
+Pseudo-Classes have the same medium specificity as **Class and Attribute Selectors**.
+
+| Selector Type | Specificity Score |
+| :--- | :--- |
+| **Pseudo-Classes** | **(0, 0, 1, 0)** |
+
+A score of **10** means they can combine effectively with classes without creating specificity nightmares.
+
+
+## Interactive Pseudo-Class Demo
+
+In this demo, observe how `:hover` changes the button color and how `:nth-child` creates a zebra-stripe pattern on the list items.
+
+
diff --git a/docs/css/selectors/pseudo-elements.mdx b/docs/css/selectors/pseudo-elements.mdx
index e345ed2..402b6de 100644
--- a/docs/css/selectors/pseudo-elements.mdx
+++ b/docs/css/selectors/pseudo-elements.mdx
@@ -1 +1,78 @@
-
\ No newline at end of file
+---
+title: Pseudo Elements
+description: "Learn how to use Pseudo-Elements (::) to style specific parts of an element, or insert decorative content before or after an element's main content."
+keywords: [CSS Pseudo-Elements, ::before, ::after, ::first-line, ::first-letter, Content Generation, CSS Selectors, CodeHarborHub]
+sidebar_label: Pseudo-Elements
+---
+
+**Pseudo-elements** allow you to style a specific, defined part of an element without needing to add extra HTML tags. They are essentially **fake elements** that exist purely in the CSS and are crucial for subtle styling and generating decorative content.
+
+Unlike **Pseudo-classes** (which we'll cover next) that style an element based on its *state* (`:hover`), Pseudo-elements style a *part* of an element (`::first-line`) or *insert* content (`::before`).
+
+
+
+
+## The Syntax: Double Colon (`::`)
+
+Pseudo-elements are written using a **double colon (`::`)** prefix. While older browsers accepted a single colon (`:`) for historical compatibility, the double colon is the **standard syntax** today, ensuring a clear distinction from pseudo-classes.
+
+### The Standard Syntax
+
+```css title="Pseudo-Element Syntax"
+selector::pseudo-element {
+ property: value;
+}
+```
+
+## The Four Main Pseudo-Elements
+
+The most common and useful pseudo-elements fall into two groups: **Structural** and **Content-Generating**.
+
+### 1. Content-Generating Pseudo-Elements (`::before` and `::after`)
+
+These are the most powerful pseudo-elements. They insert decorative content **before** or **after** the actual content of the selected element.
+
+ * **Crucial Rule:** They must always contain the `content` property, even if the value is empty (`content: "";`).
+
+| Pseudo-Element | Purpose | Example |
+| :--- | :--- | :--- |
+| `::before` | Inserts content or decoration **before** the element's main content. | `p::before { content: "💬 "; }` |
+| `::after` | Inserts content or decoration **after** the element's main content. | `.note::after { content: " *"; }` |
+
+**Common Uses:**
+
+ * Adding quotation marks or decorative icons to list items.
+ * Creating clean visual effects (like borders or triangles) using empty content.
+
+### 2. Structural Pseudo-Elements
+
+These target specific text portions of the element to apply unique typographical styling.
+
+| Pseudo-Element | Purpose | Example |
+| :--- | :--- | :--- |
+| `::first-letter` | Styles the **first letter** of the first line of a block-level element. | `h1::first-letter { font-size: 3em; }` |
+| `::first-line` | Styles the **first line** of a block-level element's text. (Note: The line length adjusts with the browser window size.) | `p::first-line { font-style: italic; }` |
+
+
+
+
+## Specificity Score
+
+Pseudo-elements have the same medium specificity as **Class Selectors** and **Attribute Selectors**.
+
+| Selector Type | Specificity Score |
+| :--- | :--- |
+| **Pseudo-Element** | **(0, 0, 1, 0)** |
+
+A score of **10** means they easily override Element Selectors but are overruled by ID Selectors.
+
+## Interactive Pseudo-Elements Demo
+
+This demo shows `::first-letter` styling the initial letter and `::before` adding a decorative icon.
+
+
+
+**Challenge:** In the CSS panel, change `p::before` to `p::after` and observe where the "»" symbol moves.
diff --git a/docs/css/selectors/simple/class.mdx b/docs/css/selectors/simple/class.mdx
index e345ed2..24d82a7 100644
--- a/docs/css/selectors/simple/class.mdx
+++ b/docs/css/selectors/simple/class.mdx
@@ -1 +1,94 @@
-
\ No newline at end of file
+---
+title: The Class Selector
+description: "Master the Class Selector (.), the most common and versatile way to target multiple specific HTML elements for styling, offering a great balance of specificity and reusability."
+keywords: [CSS Class Selector, Dot Selector, Reusable Styles, Medium Specificity, CSS Simple Selectors, CodeHarborHub]
+sidebar_label: Class Selector
+---
+
+The **Class Selector** is the workhorse of CSS. It allows you to target a specific group of elements, regardless of their HTML tag type (like `p`, `div`, or `h2`), making your styles highly reusable and easy to manage.
+
+If the Element Selector is for default, global styling, the Class Selector is for defining a distinct **design component** or **behavior** that can be applied multiple times across your page.
+
+
+
+
+## How to Use the Class Selector
+
+Using a class involves two steps:
+
+### 1. Assign the Class in HTML
+
+First, you add the `class` attribute to one or more HTML elements. You can assign the same class to any number of elements.
+
+```html title="index.html"
+Error: Check your input fields.
+Attention required.
+Close Warning
+````
+
+### 2. Select the Class in CSS
+
+In your stylesheet, you target that class name by prefixing it with a **dot (`.`)**.
+
+```css title="styles.css"
+/* The dot (.) tells the browser: "Find the element with this class name." */
+.warning {
+ border: 2px solid #ff9800; /* Amber border */
+ background-color: #fff3e0; /* Light orange background */
+ padding: 10px;
+ color: #e65100; /* Darker orange text */
+}
+```
+
+Every element assigned the class `warning` will instantly inherit these styles.
+
+### Multiple Classes
+
+An HTML element can have **multiple classes** assigned to it, separated by spaces. This is incredibly powerful for mixing and matching styles.
+
+```html
+Save Data
+```
+
+In your CSS, you would define these as separate, reusable rules:
+
+```css
+/* Base button style */
+.btn {
+ cursor: pointer;
+ border-radius: 4px;
+}
+
+/* Color/variant style */
+.btn-primary {
+ background-color: blue;
+ color: white;
+}
+
+/* Size style */
+.btn-large {
+ padding: 15px 30px;
+}
+```
+
+## Specificity Score
+
+The Class Selector has a **medium Specificity score**. It is much more specific than an Element selector, but less specific than an ID selector.
+
+| Selector Type | Specificity Score |
+| :--- | :--- |
+| **Class** | **(0, 0, 1, 0)** |
+
+This score of `10` makes it the ideal selector for component styling because it's specific enough to override default element styles but low enough that you can easily override it with utility classes or more advanced selectors if needed.
+
+
+
+
+## Interactive Class Selector Demo
+
+In this demo, the CSS targets the class `.highlight`. Notice how the `div` and the `p` tags are styled the same way because they share the class, while the regular `p` tag is ignored.
+
+
diff --git a/docs/css/selectors/simple/element.mdx b/docs/css/selectors/simple/element.mdx
index e345ed2..af0c02e 100644
--- a/docs/css/selectors/simple/element.mdx
+++ b/docs/css/selectors/simple/element.mdx
@@ -1 +1,79 @@
-
\ No newline at end of file
+---
+title: The Element Selector
+description: "Learn how to use the Element Selector (Type Selector) to target all instances of a specific HTML tag, forming the basis of CSS styling."
+keywords: [CSS Element Selector, Type Selector, HTML Tag Selector, Low Specificity, CSS Simple Selectors, CodeHarborHub]
+sidebar_label: Element Selector
+---
+
+The **Element Selector**, also known as the **Type Selector**, is the most fundamental and least specific way to target elements in CSS.
+
+It selects **all instances** of a specific HTML tag on your webpage. This selector is perfect for applying broad, default styles to common elements like paragraphs, headings, or list items.
+
+
+
+
+## How to Use the Element Selector
+
+The syntax is straightforward: you simply use the **name of the HTML tag** as your selector.
+
+### The Syntax
+
+```css title="Element Selector Syntax"
+tagname {
+ /* declarations go here */
+}
+```
+
+### Examples
+
+| Selector | Targets |
+| :--- | :--- |
+| `h1` | All `` elements. |
+| `p` | All ` ` (paragraph) elements. |
+| `a` | All `` (anchor/link) elements. |
+| `li` | All `` (list item) elements. |
+
+### Example Ruleset
+
+This ruleset applies a base font size and margin to every paragraph on the page:
+
+```css
+p {
+ font-size: 16px;
+ line-height: 1.5;
+ margin-bottom: 1em;
+}
+
+h2 {
+ color: #007bff;
+ border-bottom: 2px solid #007bff;
+ padding-bottom: 5px;
+}
+```
+
+
+## Specificity Score
+
+The Element Selector has the **lowest possible Specificity score** (excluding the Universal Selector).
+
+| Selector Type | Specificity Score |
+| :--- | :--- |
+| **Element/Type** | **(0, 0, 0, 1)** |
+
+This low score means it is easily **overridden** by any other selector, such as a Class (score 10) or an ID (score 100). This is a desired trait, as element selectors are meant to provide the **default base styles**.
+
+:::tip Base Styling
+Always use the Element Selector for **base styles** or **reset styles**. For instance, setting a default `font-family` on the `body` tag, or setting `margin: 0;` on all `p` tags. This establishes a clean foundation that more specific rules can easily customize.
+:::
+
+
+
+
+## Interactive Element Selector Demo
+
+In the live editor, the CSS targets the `div` and `p` elements. Notice how every instance of those tags is affected.
+
+
\ No newline at end of file
diff --git a/docs/css/selectors/simple/grouping.mdx b/docs/css/selectors/simple/grouping.mdx
index e345ed2..61fc1ec 100644
--- a/docs/css/selectors/simple/grouping.mdx
+++ b/docs/css/selectors/simple/grouping.mdx
@@ -1 +1,103 @@
-
\ No newline at end of file
+---
+title: The Grouping Selector
+description: "Learn how to use the Grouping Selector (comma-separated list) to apply the exact same styles to multiple, different selectors in a single, efficient CSS ruleset."
+keywords: [CSS Grouping Selector, Comma Selector, CSS Efficiency, Code Duplication, Simple Selectors, CodeHarborHub]
+sidebar_label: Grouping Selector
+---
+
+So far, we've focused on styling one element or one type of element at a time. But what if you have ten different elements that all need the **exact same style**?
+
+The **Grouping Selector** provides the perfect solution. It allows you to combine multiple selectors into a single ruleset, drastically reducing code duplication and making your CSS much cleaner.
+
+
+
+
+## How to Use the Grouping Selector
+
+To group selectors, you simply list them one after another, separated by a **comma (`,`)**.
+
+### The Syntax
+
+```css title="Grouping Selector Syntax"
+selector-1, selector-2, selector-3, ... {
+ /* declarations go here */
+}
+```
+
+### Examples
+
+You can group any combination of simple selectors:
+
+| Grouping Example | Targets |
+| :--- | :--- |
+| `h1, h2, h3` | All level 1, 2, and 3 headings. |
+| `.card, .modal, .toast` | All elements with the classes `card`, `modal`, or `toast`. |
+| `p, #footer, .note` | All paragraphs, the unique element with `id="footer"`, and all elements with the class `note`. |
+
+### Grouping in Action
+
+Instead of writing this verbose, repetitive code:
+
+
+
+
+```css
+h1 {
+ font-family: 'Poppins', sans-serif;
+ color: #333;
+}
+h2 {
+ font-family: 'Poppins', sans-serif;
+ color: #333;
+}
+.sidebar-title {
+ font-family: 'Poppins', sans-serif;
+ color: #333;
+}
+```
+
+
+
+
+```css
+/* Grouping all three selectors together */
+h1, h2, .sidebar-title {
+ font-family: 'Poppins', sans-serif;
+ color: #333;
+}
+```
+
+
+
+
+The grouped code achieves the exact same result using just one ruleset\!
+
+
+
+
+## Why Grouping is a Best Practice
+
+1. **Reduced Code Size (Efficiency):** It minimizes the total number of lines in your stylesheet, which makes the file size smaller and faster to download.
+2. **Maintainability:** If you need to update the shared styles (e.g., change the font-family), you only have one place to make the edit.
+3. **Readability:** It makes the intent of your CSS clear—you are explicitly stating that these distinct elements are meant to look alike.
+
+### Note on Specificity
+
+When selectors are grouped, the browser calculates the **Specificity Score** for **each individual selector** separately.
+
+**Example:**
+If you have the rule: `.box, #unique-title { color: purple; }`
+
+ * When styling the element with the class `.box`, the specificity is **10**.
+ * When styling the element with the ID `#unique-title`, the specificity is **100**.
+
+The Grouping Selector does **not** change the individual power of the selectors it contains.
+
+### Interactive Grouping Selector Demo
+
+In the live editor, the CSS uses the grouping selector to target a Class, an Element, and a unique ID all at once. If you remove any selector from the comma-separated list, the corresponding element will lose the styling.
+
+
\ No newline at end of file
diff --git a/docs/css/selectors/simple/id.mdx b/docs/css/selectors/simple/id.mdx
index e345ed2..0ce3473 100644
--- a/docs/css/selectors/simple/id.mdx
+++ b/docs/css/selectors/simple/id.mdx
@@ -1 +1,71 @@
-
\ No newline at end of file
+---
+title: The ID Selector
+description: "Understand the ID Selector (#), its unique nature, and its extremely high specificity. Learn why it is generally reserved for JavaScript and structural targeting, not widespread styling."
+keywords: [CSS ID Selector, Hash Selector, Unique Element, High Specificity, CSS Simple Selectors, CodeHarborHub]
+sidebar_label: ID Selector
+---
+
+The **ID Selector** is the most powerful simple selector you can use for styling. It is designed to target **one, and only one, unique element** on an entire HTML page.
+
+Due to its high specificity, the ID Selector is often considered too powerful for general styling and is usually reserved for structural landmarks or elements that need specific manipulation by **JavaScript**.
+
+
+
+
+## How to Use the ID Selector
+
+Using the ID selector also requires two steps, similar to the class selector, but with a strict limitation on usage.
+
+### 1. Assign the ID in HTML
+
+You add the `id` attribute to an HTML element. **Crucially, the value of the `id` attribute must be unique.** You cannot reuse the same ID on another element on the page.
+
+```html title="index.html"
+
+
+This is standard content.
+```
+
+### 2. Select the ID in CSS
+
+In your stylesheet, you target that unique ID name by prefixing it with a **hash symbol (`#`)** (also known as a pound sign).
+
+```css title="styles.css"
+/* The hash (#) tells the browser: "Find the single element with this ID." */
+#main-header {
+ background-color: #3f51b5; /* Deep Indigo */
+ color: white;
+ padding: 20px 0;
+ text-align: center;
+}
+```
+
+## Specificity Score: The Atomic Bomb of CSS
+
+The ID Selector has an extremely high Specificity score, which is why it should be used sparingly for styling.
+
+| Selector Type | Specificity Score |
+| :--- | :--- |
+| **ID** | **(0, 1, 0, 0)** |
+
+A score of **100** means an ID selector will override *ten* class selectors or *one hundred* element selectors trying to style the same property\!
+
+:::danger Use IDs with Caution
+Because the ID selector is so specific, using it for general styling can make your CSS fragile and difficult to maintain. It makes it very hard to override that style later without resorting to the forbidden power of `!important`.
+
+**General Rule:** Use **Classes** for styling and **IDs** primarily for structural landmarks or targets for **JavaScript functions** (e.g., scrolling to `#contact-form`).
+:::
+
+
+
+
+## Interactive ID Selector Demo
+
+In this demo, observe how the ID selector (`#unique-style`) completely overrides the styles applied by the less specific Class selector (`.base-box`), even though the class rule is written *after* the ID rule in the code panel.
+
+
diff --git a/docs/css/selectors/simple/universal.mdx b/docs/css/selectors/simple/universal.mdx
index e345ed2..fe59233 100644
--- a/docs/css/selectors/simple/universal.mdx
+++ b/docs/css/selectors/simple/universal.mdx
@@ -1 +1,89 @@
-
\ No newline at end of file
+---
+title: The Universal Selector
+description: "Learn how to use the Universal Selector (*) to target every single element on a web page, and why it is primarily used for global CSS resets."
+keywords: [CSS Universal Selector, Asterisk Selector, Global Targeting, CSS Reset, Low Specificity, CSS Simple Selectors, CodeHarborHub]
+sidebar_label: Universal Selector
+---
+
+The **Universal Selector** is the simplest and broadest selector in CSS. It is represented by a single **asterisk (`*`)** and does exactly what its name suggests: it targets **every single element** on the HTML page.
+
+This includes all tags like ``, ``, `p`, `img`, and even hidden elements like `` content.
+
+
+
+
+## How to Use the Universal Selector
+
+The syntax is just the asterisk, followed by the declaration block.
+
+### The Syntax
+
+```css title="Universal Selector Syntax"
+* {
+ /* declarations go here */
+}
+```
+
+### Example: The CSS Reset
+
+The Universal Selector is most commonly used to perform a **CSS Reset**. This involves clearing default browser styles (like margins and padding) that can cause inconsistencies between different web browsers.
+
+```css title="styles.css"
+/* This essential rule removes default padding and margin from every element */
+* {
+ margin: 0;
+ padding: 0;
+ box-sizing: border-box; /* Crucial for box model consistency! */
+}
+```
+
+## Specificity Score and Performance
+
+The Universal Selector has the lowest specificity score of all selectors.
+
+| Selector Type | Specificity Score |
+| :--- | :--- |
+| **Universal** | **(0, 0, 0, 0)** |
+
+### Performance and Caution
+
+:::danger Use Sparingly!
+Due to the way browsers calculate styles, using the Universal Selector (`*`) for general styling (like setting a background color) is generally discouraged for large sites.
+
+While modern browsers are fast, applying complex styles to *every single element* (including tags you didn't even know existed) can be slightly inefficient. **Only use it for global resets.**
+:::
+
+
+
+
+## Best Use Case: The `box-sizing` Rule
+
+The most famous and beneficial use of the Universal Selector is to enforce consistent box model behavior across your entire site.
+
+In standard CSS, when you set an element's `width`, padding and border are *added* to that width, often resulting in unexpected layouts. By setting `box-sizing: border-box;`, the padding and border are instead *included* within the defined width.
+
+This single ruleset is often included at the very top of professional stylesheets:
+
+```css title="styles.css"
+/* 1. Target EVERYTHING */
+* {
+ box-sizing: border-box;
+ margin: 0;
+ padding: 0;
+}
+
+/* 2. Target pseudo-elements, which often need the same reset */
+*::before,
+*::after {
+ box-sizing: border-box;
+}
+```
+
+## Interactive Universal Selector Demo
+
+In this demo, the universal selector (`*`) styles every element you see, while a slightly more specific Element Selector (`p`) overrides only the paragraph text color.
+
+
\ No newline at end of file