Unit 1: HTML5 and CSS3 Foundations — Comprehensive Study Notes
1. HTML5 Document Architecture and Modern Standards
1.1 The Living Standard and Modern Doctype Declaration
HTML (HyperText Markup Language) provides the structural foundation of the World Wide Web. Governed by the Web Hypertext Application Technology Working Group (WHATWG) as a Living Standard, HTML5 eliminates the cumbersome Document Type Definitions (DTDs) of older SGML/XML specifications.
Every modern HTML5 document initiates with a clean, case-insensitive doctype preamble:
html<!DOCTYPE html>
Purpose of <!DOCTYPE html>:
- Quirks Mode vs. Standards Mode: Modern web browsers include legacy rendering engines. Omitting the doctype forces the rendering engine into Quirks Mode, emulating non-standard behaviors of late-1990s browsers (such as Internet Explorer 5.5's non-standard box model). The doctype declaration commands the browser to parse and render the document in full Standards Mode (also known as "No-Quirks Mode").
- Parsing Simplicity: The declaration informs the browser's HTML parser to adhere strictly to the WHATWG HTML specification without loading external DTD validation schemas over HTTP.
1.2 Anatomy of the HTML Boilerplate and Document Metadata
html<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="description" content="Authoritative study notes for modern web engineering.">
<meta property="og:title" content="HTML5 & CSS3 Masterclass">
<meta property="og:description" content="Deep dive into web foundations.">
<meta property="og:image" content="https://example.com/social-card.png">
<title>Enterprise Web Development | Foundations</title>
<link rel="stylesheet" href="styles.css">
<link rel="icon" type="image/svg+xml" href="/favicon.svg">
</head>
<body>
<noscript>This application requires JavaScript to function properly.</noscript>
<!-- Document content renders here -->
</body>
</html>
Detailed Element Breakdown:
<html lang="en">: The root element of the document. Thelangattribute is critical for Accessibility (a11y), informing screen readers which speech synthesizer dictionary to load for accurate pronunciation, and aiding search engine linguistic indexing.<meta charset="UTF-8">: Specifies the character encoding format. UTF-8 (8-bit Unicode Transformation Format) encodes all valid Unicode code points, ensuring universal rendering of international alphabets, emojis, and mathematical symbols without mojibake (garbled characters).<meta name="viewport" content="width=device-width, initial-scale=1.0">: The cornerstone of responsive web design.width=device-width: Overrides the mobile browser's default 980px desktop virtual canvas, setting the viewport width equal to the physical screen width of the device in CSS pixels.initial-scale=1.0: Establishes a 1:1 relationship between CSS pixels and device-independent pixels when the page initially loads, preventing awkward auto-zooming.
<title>: Defines the document title displayed in the browser tab, bookmark archives, and search engine results pages (SERPs).<link rel="stylesheet">: Links external CSS stylesheets via a non-blocking asynchronous request pipeline.<meta property="og:*">: Open Graph protocol metadata utilized by social networking platforms (LinkedIn, Facebook, X) to generate structured rich preview cards when links are shared.
2. Semantic HTML Elements and Web Accessibility (a11y)
2.1 Structural Landmark Elements vs. Generic Containers
Prior to HTML5, developers relied on generic <div> elements decorated with idiosyncratic classes (e.g., <div id="nav"> or <div class="footer">). HTML5 introduced dedicated Semantic Landmark Elements that communicate structural meaning to search crawlers, browser layout engines, and assistive screen reader technologies.
CODE+-----------------------------------------------------------------------------------+ | HTML5 SEMANTIC PAGE ARCHITECTURE | | | | +-----------------------------------------------------------------------------+ | | | <header> (Site Identity, Primary Branding, Top-Level Utility Links) | | | | +-----------------------------------------------------------------------+ | | | | | <nav> (Primary Navigational Menus: Accessible unordered lists) | | | | | +-----------------------------------------------------------------------+ | | | +-----------------------------------------------------------------------------+ | | | | +------------------------------------------------------+ +-------------------+ | | | <main> (Dominant, Unique Content of the Document) | | <aside> | | | | | | (Complementary, | | | | +------------------------------------------------+ | | Contextual info: | | | | | <article> (Self-Contained Syndicatable Unit) | | | Sidebar ads, | | | | | - <h2> Article Title | | | author bio, | | | | | +------------------------------------------+ | | related links) | | | | | | <section> (Thematic Grouping of Content) | | | | | | | | | +------------------------------------------+ | | | | | | | +------------------------------------------------+ | | | | | +------------------------------------------------------+ +-------------------+ | | | | +-----------------------------------------------------------------------------+ | | | <footer> (Authorship, Copyright Notices, Legal Terms, Secondary Navigation) | | | +-----------------------------------------------------------------------------+ | +-----------------------------------------------------------------------------------+
Semantic Element Definitions:
<header>: Represents introductory content, branding logos, navigational drawers, or search bars for its nearest ancestor sectioning container.<nav>: Designates major navigational blocks containing links to other pages or internal document sections. Screen readers provide keyboard shortcuts allowing visually impaired users to jump directly past or into<nav>blocks.<main>: Encloses the central, non-repeating content unique to the current document. It must not appear as a descendant of<header>,<nav>,<aside>, or<footer>, and there should only be one visible<main>element per document.<article>: Represents an independent, self-contained composition that makes sense on its own and is capable of independent syndication (e.g., a blog post, news report, forum thread, or e-commerce product card).<section>: A generic thematic grouping of content, typically introduced by an explicit heading (<h2>-<h6>).<aside>: Content tangentially related to the content around it (e.g., glossaries, sidebars, related reading links, author biographies).<footer>: Represents a footer for its nearest sectioning context, typically containing copyright data, terms of service links, and sitemaps.<figure>and<figcaption>: Encapsulates self-contained media (illustrations, diagrams, code snippets) along with an explicit textual caption.
2.2 Web Content Accessibility Guidelines (WCAG) and ARIA Basics
Web Accessibility (a11y) ensures that digital applications can be perceived, navigated, and operated by users with visual, auditory, motor, or cognitive disabilities.
- The Golden Rule of ARIA: "First rule of ARIA: Do not use ARIA if there is an existing native HTML element or attribute you can use instead." Native semantic HTML (e.g.,
<button>or<input type="checkbox">) natively exposes keyboard accessibility (Tab focus, Enter/Space activation) and accessibility tree bindings without manual configuration. - ARIA (Accessible Rich Internet Applications): When custom UI components (such as modal dialogs, tabs, or accordions) are built using generic elements, ARIA attributes communicate roles and states to assistive technology:
role="dialog": Declares the container as a modal window.aria-expanded="true|false": Indicates whether an accordion or dropdown menu is open or collapsed.aria-hidden="true": Hides purely decorative elements (icons, graphics) from screen readers.aria-label="Close modal": Provides an explicit textual accessible name for icon-only buttons lacking visible text.
3. Modern Forms, Input Controls, and Validation Architecture
3.1 Accessible Form Construction and Label Binding
HTML forms collect, validate, and submit user data to server endpoints. Form accessibility requires rigid programmatic binding between input fields and their describing labels.
html<!-- Explicit Binding via for/id Relationship -->
<div class="form-group">
<label for="user-email">Professional Email Address</label>
<input
type="email"
id="user-email"
name="email"
required
autocomplete="email"
placeholder="name@company.com"
aria-describedby="email-hint"
>
<span id="email-hint" class="hint-text">We will never share your corporate email.</span>
</div>
- Clicking an explicitly bound
<label>transfers keyboard focus directly into the corresponding<input>control and toggles radio buttons or checkboxes, expanding the interactive hit area for touch devices.
3.2 HTML5 Specialized Input Types and Native Attributes
HTML5 introduced specialized type attributes that invoke platform-optimized mobile keyboards (e.g., displaying numeric keypads for numbers or @ symbols for email addresses) and native browser validation engines:
CODE+-----------------------------------------------------------------------------------+ | HTML5 FORM CONTROLS & ATTRIBUTES | | Element / Type | Behavioral Function | Native Validation | |---------------------+------------------------------------+------------------------| | type="email" | Enforces email syntax formatting. | Validates '@' & domain | | type="tel" | Invokes telephone keypad on mobile.| Use 'pattern' regex | | type="url" | Enforces valid URL protocol (http).| Validates full URL | | type="number" | Numeric inputs with step spinners. | 'min', 'max', 'step' | | type="date" | Invokes native operating OS picker.| 'min', 'max' date limits| | type="range" | Renders a visual slider bar. | 'min', 'max', 'step' | | <datalist> | Autocomplete suggestions dropdown. | Linked via 'list' attr | | <fieldset> | Groups related inputs logically. | Labeled via <legend> | | required | Form cannot submit if empty. | Browser warning popup | | pattern="[A-Z]{3}" | Enforces custom regex matching. | Client-side regex check| +-----------------------------------------------------------------------------------+
3.3 The Constraint Validation API and Pseudo-Classes
Modern browsers provide native client-side validation without requiring external JavaScript libraries:
- Validation Attributes:
required,pattern,minlength,maxlength,min,max,step. - CSS Validation Pseudo-Classes:
:valid: Matches elements whose values meet all validation constraints.:invalid: Matches elements currently violating one or more constraints.:user-validand:user-invalid: Modern CSS selectors that apply styling only after the user has actively interacted with and blurred the input, eliminating aggressive red error borders on freshly loaded, un-filled forms.
- JavaScript Constraint Validation API: Exposes
element.checkValidity(),element.validity(returning boolean flags likevalueMissing,typeMismatch,patternMismatch), andelement.setCustomValidity("Custom error text").
4. Responsive Multimedia and Embedded Content
4.1 Native Audio and Video Implementation
HTML5 deprecated proprietary third-party browser plugins (Adobe Flash, Silverlight) in favor of native <audio> and <video> elements:
html<video controls width="800" poster="/assets/poster.jpg" preload="metadata">
<source src="/media/video.webm" type="video/webm">
<source src="/media/video.mp4" type="video/mp4">
<track kind="subtitles" src="/media/subs-en.vtt" srclang="en" label="English" default>
<p>Your browser does not support HTML5 video. <a href="/media/video.mp4">Download video</a>.</p>
</video>
- Multiple
<source>Tags: Browsers evaluate source tags in sequential order, loading the first codec format they support (e.g., modern, highly compressed WebM/VP9 first, falling back to universal MP4/H.264). - Accessibility with
<track>: Connects WebVTT (.vtt) files to display synchronized subtitles, closed captions, and audio descriptions for hearing-impaired audiences. - Attributes:
controls(displays playback UI),autoplay(often restricted unlessmutedis also present),loop,poster(thumbnail placeholder),preload="none|metadata|auto".
4.2 Responsive Images: The <picture> Element and srcset
Serving multi-megabyte desktop hero images to mobile devices over constrained cellular networks degrades page speed and Core Web Vitals (Largest Contentful Paint). HTML5 resolves this through resolution switching and art direction:
html<!-- Art Direction and Format Negotiation -->
<picture>
<!-- Serve modern AVIF format if supported -->
<source type="image/avif" srcset="/img/hero-mobile.avif 400w, /img/hero-desktop.avif 1200w" sizes="(max-width: 600px) 100vw, 1200px">
<!-- Fallback to WebP format -->
<source type="image/webp" srcset="/img/hero-mobile.webp 400w, /img/hero-desktop.webp 1200w" sizes="(max-width: 600px) 100vw, 1200px">
<!-- Baseline universal JPEG fallback -->
<img src="/img/hero-fallback.jpg" alt="Engineers collaborating in modern lab" width="1200" height="600" loading="lazy" decoding="async">
</picture>
srcset: Supplies a comma-separated list of image file paths accompanied by their intrinsic pixel width descriptors (e.g.,400w,1200w).sizes: Informs the browser's layout engine what physical display slot width the image will occupy across various media query breakpoints before CSS styles are downloaded and parsed.loading="lazy": Defers offscreen image loading until the user scrolls within proximity of the viewport, conserving mobile bandwidth.decoding="async": Offloads image decompression to a background thread, preventing main-thread rendering jank.
4.3 Vector Graphics (SVG) vs. Raster Canvas
- Scalable Vector Graphics (SVG): XML-based vector format. Retained mode graphics represented in the DOM; resolution-independent, infinitely scalable without pixelation, styles can be manipulated via CSS, and individual paths support interactive JavaScript event listeners. Ideal for logos, UI icons, and interactive data visualization charts.
- HTML5
<canvas>: Immediate-mode procedural drawing surface manipulated via JavaScript pixel drawing APIs (CanvasRenderingContext2D). Does not create DOM nodes for drawn shapes; highly performant for high-frame-rate 2D/3D games, particle simulations, and real-time video processing.
5. CSS Cascading Rules, Inheritance, and Specificity Architecture
5.1 The Three Pillars of CSS: The Cascade
The Cascade is the algorithmic engine that resolves conflicts when multiple CSS rules target the exact same HTML element property. It evaluates declarations across three sequential criteria:
- Origin and Importance:
- User Agent Normal Stylesheets (browser default)
- User Normal Stylesheets
- Author Normal Stylesheets (developer styles)
- Author
!importantStylesheets - User
!importantStylesheets - User Agent
!importantStylesheets
- Specificity: If origins and importance are equal, the rule with the higher specificity score wins.
- Source Order (Proximity): If specificity scores are identical, the rule declared last in the stylesheet or document order overrides earlier rules.
5.2 Specificity Calculation Mechanics
Specificity is calculated as a 4-component vector :
CODE+-----------------------------------------------------------------------------------+ | CSS SPECIFICITY CALCULATION VECTOR | | Tier | Category | Elements Matched | Weight Value | |------+-----------------------------+------------------------------+---------------| | a | Inline Styles | style="..." attribute in HTML| (1, 0, 0, 0) | | b | ID Selectors | #header, #navigation | (0, 1, 0, 0) | | c | Classes, Attributes, | .btn, [type="text"], | (0, 0, 1, 0) | | | Pseudo-classes | :hover, :nth-child(2) | | | d | Elements, Pseudo-elements | div, h1, p, ::before, ::after| (0, 0, 0, 1) | +-----------------------------------------------------------------------------------+
Comparison Examples:
p.card p#main .card p#main .card p:hover<p style="color: red;">
Crucial Rule: Specificity values never "carry over" like base-10 mathematics. No amount of class selectors (even 1,000 .class rules) can ever override a single #id selector.
- The
:is(),:where(), and:not()Pseudo-Classes::is(.a, .b, #c)takes the specificity of its most specific argument (#cID specificity).:where(.a, .b, #c)always has zero specificity , ideal for creating low-specificity CSS resets.
5.3 Inheritance and CSS Explicit Keywords
Certain CSS properties naturally inherit from parent elements to child elements down the DOM tree (e.g., color, font-family, line-height, text-align), while structural box-model properties do not (e.g., margin, padding, border, width, background).
Explicit Inheritance Keywords:
inherit: Forces a property to take the computed value of its immediate parent element.initial: Resets the property to the initial value defined in the official W3C CSS specification.unset: Acts asinheritif the property naturally inherits, orinitialif it does not.revert: Resets the property to the value established by the user agent stylesheet (browser default).
6. The CSS Box Model and Layout Formatting Contexts
6.1 Standard Box Model vs. Alternate border-box
Every HTML element rendered in a visual formatting context is structured as a rectangular box comprising four concentric layers: Content, Padding, Border, and Margin.
CODE+-----------------------------------------------------------------------------------+ | THE CSS BOX MODEL LAYERS | | | | +-----------------------------------------------------------------------------+ | | | MARGIN (Transparent spacing separating element from adjacent siblings) | | | | +-----------------------------------------------------------------------+ | | | | | BORDER (Visible outline surrounding padding and content) | | | | | | +-----------------------------------------------------------------+ | | | | | | | PADDING (Inner breathing space clearing area around content) | | | | | | | | +-----------------------------------------------------------+ | | | | | | | | | CONTENT (Actual text, image, or child element rendering) | | | | | | | | | +-----------------------------------------------------------+ | | | | | | | +-----------------------------------------------------------------+ | | | | | +-----------------------------------------------------------------------+ | | | +-----------------------------------------------------------------------------+ | +-----------------------------------------------------------------------------------+
Mathematical Formulas for Rendered Width:
box-sizing: content-box(W3C Default):
Thewidthproperty defines only the Content box width. Padding and borders are added on top:
Problem: If an element haswidth: 100%andpadding: 20px, total width becomes , causing horizontal scrollbar overflow.box-sizing: border-box(Universal Modern Standard):
Thewidthproperty encompasses Content, Padding, and Border:
Content width is automatically compressed to accommodate padding and borders without altering outer dimensions.
css/* Universal Box-Sizing Reset */
*, *::before, *::after {
box-sizing: border-box;
margin: 0;
padding: 0;
}
6.2 Margin Collapsing Mechanics
Vertical margins of adjacent block-level elements in normal flow often combine into a single margin. The collapsed margin height equals the maximum of the individual margins (or if negative, the largest positive minus absolute largest negative).
Scenarios Where Margin Collapsing Occurs:
- Adjacent Siblings: Bottom margin of element A collapses into the top margin of immediately succeeding element B.
- Parent and First/Last Child: Top margin of a child collapses with the top margin of its parent if there is no border, padding, inline content, or clearance separating them.
- Empty Blocks: An empty element with top and bottom margins collapses with itself.
Exceptions: Margin collapsing never occurs between flex items, grid items, absolutely positioned elements, floated elements, or elements establishing a new Block Formatting Context (BFC).
7. Display Paradigms and Positioning Schemes
7.1 The display Property Taxonomy
display: block: Starts on a new line; stretches horizontally to fill available parent container width; respects width, height, margin, and padding.display: inline: Flows horizontally within text lines; ignores vertical width, height, top/bottom margins, and top/bottom padding for layout sizing (though horizontal padding/margin apply).display: inline-block: Flows inline with surrounding text horizontally, but respects width, height, vertical margins, and vertical padding.display: none: Completely removes the element from the visual accessibility tree and layout flow, occupying zero screen pixels. (Contrast withvisibility: hidden, which hides rendering but preserves the element's layout footprint).
7.2 The Five CSS Positioning Schemes
The position property dictates the coordinate coordinate scheme and stacking layer of an element:
CODE+-----------------------------------------------------------------------------------+ | CSS POSITIONING SCHEMES MATRIX | | Scheme | Normal Flow? | Coordinate Reference Point | Creates Stacking? | |-----------+--------------+-----------------------------------+--------------------| | static | Yes | Default document order. Offsets | No | | | | (top, left) have zero effect. | | | relative | Yes | Offsets relative to its OWN normal| Yes (if z-index | | | | default position; leaves void gap.| is non-auto) | | absolute | No (Removed) | Offsets relative to nearest non- | Yes (if z-index | | | | static positioned ancestor. | is non-auto) | | fixed | No (Removed) | Offsets relative to the physical | Yes (if z-index | | | | viewport; stays fixed on scroll. | is non-auto) | | sticky | Hybrid | Acts 'relative' until scroll hit | Yes (if z-index | | | | boundary, then acts 'fixed'. | is non-auto) | +-----------------------------------------------------------------------------------+
8. Modern Layout Modules: Flexbox (1D) vs. CSS Grid (2D)
8.1 Flexbox: One-Dimensional Layout Engine
Flexbox (display: flex) aligns and distributes space among items along a single dimension at a time (either as a row or as a column).
CODE+-----------------------------------------------------------------------------------+ | THE FLEXBOX ARCHITECTURE | | | | Cross-Start | | │ | | ▼ ┌─────────────────────────────────────────────────────────────┐ | | │ [Item 1] [Item 2] [Item 3] │ | | │ │ | | ▲ └─────────────────────────────────────────────────────────────┘ | | │ | | Cross-End ────────────────────────────────────────────────────────► | | Main-Start Main-End | +-----------------------------------------------------------------------------------+
Core Container Properties:
flex-direction: Sets the Main Axis (row,row-reverse,column,column-reverse).justify-content: Distributes alignment along the Main Axis (flex-start,flex-end,center,space-between,space-around,space-evenly).align-items: Distributes alignment along the Cross Axis (stretch,flex-start,flex-end,center,baseline).gap: Defines explicit spacing between adjacent flex items without margin hacks.
Core Flex Item Properties:
flex-grow: Defines the ability for a flex item to expand and absorb remaining available free space (proportional ratio).flex-shrink: Defines the ability for an item to compress when total item size exceeds container dimensions (default is1).flex-basis: Defines the default initial size of an item before remaining space is distributed (autoor length value).- Shorthand:
flex: 1 1 200px(flex-grow flex-shrink flex-basis).
8.2 CSS Grid: Two-Dimensional Layout Engine
CSS Grid (display: grid) orchestrates simultaneous alignment along both rows and columns, providing complete structural control over complex page layouts.
css/* Responsive Grid Without Media Queries */
.grid-container {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
gap: 1.5rem;
}
grid-template-columns/grid-template-rows: Defines explicit column and row tracks.- The
fr(Fractional) Unit: Represents a fraction of the available free space in the grid container. repeat(auto-fit, minmax(280px, 1fr)): Creates a responsive grid that automatically wraps items into new rows when available space drops below 280px without declaring@mediaqueries.grid-template-areas: Enables visual ASCII-art layout mapping:
css.layout {
display: grid;
grid-template-areas:
"header header"
"sidebar main"
"footer footer";
}
9. Responsive Web Design and Fluid Mathematical Functions
9.1 The Mobile-First Responsive Methodology
Mobile-First design dictates authoring base CSS styles optimized for small mobile screens first, subsequently layering complexity for wider desktop viewports using min-width media queries:
css/* Base styles: Mobile viewports (< 768px) */
.container {
width: 100%;
padding: 1rem;
}
/* Tablet breakpoint: (>= 768px) */
@media (min-width: 768px) {
.container {
max-width: 720px;
margin: 0 auto;
}
}
/* Modern Range Syntax */
@media (width >= 1024px) {
.container {
max-width: 960px;
}
}
9.2 Units of Measurement: Absolute vs. Relative
- Absolute:
px(Pixels: 1/96th of an inch). Predictable, but does not respect user browser font size preferences. - Relative to Font:
em: Relative to the font-size of the element itself (or parent font-size if used onfont-size), compounding down nested trees.rem(Root EM): Relative to the font-size of the root<html>element (default 16px). Eliminates compounding errors; foundational for scalable typography.
- Relative to Viewport:
vw(1% of viewport width),vh(1% of viewport height),dvh(Dynamic Viewport Height, adjusting dynamically to mobile browser address bars).
Modern CSS Math Functions:
calc(100% - 40px): Combines mixed units mathematically.clamp(min, preferred, max): Fluid typography and sizing without media queries:cssfont-size: clamp(1rem, 2.5vw + 0.5rem, 2rem);
10. Modern CSS Workflows: Custom Properties, Resets, and Methodologies
10.1 CSS Custom Properties (Variables)
Unlike preprocessor variables (Sass $var), native CSS Custom Properties are dynamic, accessible in the runtime DOM, inherit down the tree, and can be modified on the fly via media queries or JavaScript:
css:root {
--primary-color: #2563eb;
--surface-bg: #ffffff;
--text-primary: #1e293b;
--border-radius-md: 8px;
}
[data-theme="dark"] {
--surface-bg: #0f172a;
--text-primary: #f8fafc;
}
.button {
background-color: var(--primary-color);
border-radius: var(--border-radius-md);
color: var(--surface-bg);
}
10.2 CSS Resets vs. Normalize.css
- CSS Reset (e.g., Eric Meyer's Reset): Strips all default browser styling completely, setting margins, paddings, and font sizes to zero to provide a blank canvas.
- Normalize.css: Preserves useful browser default styles (like form controls and heading sizes) while correcting cross-browser inconsistencies and normalization bugs.
10.3 The BEM (Block-Element-Modifier) Architecture
BEM is a modular naming convention designed to eliminate specificity conflicts:
- Block (
.card): Standalone entity that has independent meaning. - Element (
.card__title): Part of a block that has no standalone meaning and is semantically tied to its block. - Modifier (
.card--featured): Flag on a block or element used to change appearance or behavior.
11. Version Control Fundamentals: Git and GitHub Architecture
11.1 The Distributed Architecture of Git
Git is a distributed version control system (DVCS) that records snapshots of a file system over time:
CODE+-----------------------------------------------------------------------------------+ | THE THREE STATES OF GIT | | | | [ Working Directory ] ─── git add ───► [ Staging Area / Index ] | | (Untracked & Modified files) (Prepared snapshot ready for commit) | | │ | | git commit | | │ | | ▼ | | [ Remote Repository ] ◄── git push ─── [ Local Repository (.git) ] | | (GitHub / GitLab shared origin) (Committed snapshots stored permanently) | +-----------------------------------------------------------------------------------+
11.2 Core Git Operations and Command Workflows
git init: Initializes an empty Git repository in the current working directory, creating the hidden.git/folder.git clone <url>: Downloads an entire remote repository, history, and all branches to the local machine.git status: Inspects the state of the working directory and staging area, highlighting untracked, modified, or staged files.git add <file>/git add .: Stages modified files, preparing them for the next commit.git commit -m "feat: implement responsive navigation bar": Creates an immutable snapshot in the local repository identified by a unique SHA-1/SHA-256 hash.git branch <branch-name>/git switch -c <branch-name>: Creates and switches to an isolated development branch.git merge <branch-name>: Combines histories from another branch into the current checked-out branch.git push origin <branch-name>: Uploads local branch commits to the remote GitHub hosting repository.git pull origin <branch-name>: Fetches and integrates remote changes into the current local branch.