# albertprofecet/17-position_absolute architecture

> Architecture diagram of the GitHub repository albertprofecet/17-position_absolute, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-19). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/albertprofecet/17-position_absolute
- Repository: https://github.com/albertprofecet/17-position_absolute

## Overview

##### Project type and purpose
- This is a small, front-end-only static website whose sole purpose is to demonstrate CSS positioning (absolute vs. relative).
- There is no backend or dynamic logic; the entire “application” consists of an HTML file and an associated stylesheet.

##### File structure
- Top level:
- INDEX.HTML – the entry point
- style.css – the CSS file defining styles and positioning rules
- README.md – a brief note about “Position Absolute i relative”
- No scripts, no server code, no build tools, no tests—this is pure static content.

##### README for additional insights
- The README confirms the focus: illustrating how CSS’s ‘position: absolute’ and ‘position: relative’ work.
- No reference to frameworks, build processes, or third-party dependencies.

##### Components
a. Static File Host (e.g., web server or CDN)
– SERVES: index.html, style.css
b. Browser
– Requests the files
– Contains subcomponents:
- HTML Parser / DOM Builder
- CSS Parser / Style Computation
- Layout Engine (applies absolute/relative positioning rules)
- Rendering / Paint Layer
c. User’s Viewport

##### Relationships and interactions
- The Browser issues an HTTP GET to the Static File Host for index.html
- index.html has a <link> to style.css → Browser issues a second GET
- The HTML Parser builds the DOM, the CSS Parser builds the CSSOM
- The Layout Engine merges DOM + CSSOM to compute final on-screen positions (absolute vs. relative)
- Finally, the Rendering Engine paints the positioned elements in the user’s viewport.

##### Architectural patterns and design principles
- Single-page static architecture
- Clear separation of concerns: content (HTML) vs. presentation (CSS)
- No client-side scripts or build step simplifies the model to “request → parse → render.”

## Diagram (Mermaid)

```mermaid
flowchart TD
    User["User"]:::user -->|opens browser| BrowserBox

    subgraph "Browser" 
        direction TB
        HTMLParser["HTML Parser / DOM Builder"]:::browser
        CSSParser["CSS Parser / CSSOM Builder"]:::browser
        LayoutEngine["Layout Engine\n(Absolute vs. Relative Positioning)"]:::browser
        RenderEngine["Render Engine"]:::browser
    end

    BrowserBox["Browser"]:::browserContainer

    BrowserBox -->|HTTP GET index.html| StaticHost
    StaticHost -->|index.html| BrowserBox
    BrowserBox -->|HTTP GET style.css| StaticHost
    StaticHost -->|style.css| BrowserBox

    subgraph "Static File Host\n(e.g., nginx/CDN)" 
        direction TB
        Index["index.html"]:::file
        Style["style.css"]:::file
    end

    BrowserBox -->|provides index.html| HTMLParser
    BrowserBox -->|provides style.css| CSSParser

    HTMLParser -->|DOM| LayoutEngine
    CSSParser -->|CSSOM| LayoutEngine
    LayoutEngine -->|computed layout| RenderEngine
    RenderEngine -->|paint to viewport| Viewport

    Viewport["User Viewport\n(Rendered Output)"]:::viewport

    click StaticHost "https://github.com/albertprofecet/17-position_absolute/tree/main//"
    click Index "https://github.com/albertprofecet/17-position_absolute/blob/main//INDEX.HTML"
    click Style "https://github.com/albertprofecet/17-position_absolute/blob/main//style.css"

    classDef host fill:#ADD8E6,stroke:#000;
    classDef browser fill:#90EE90,stroke:#000;
    classDef browserContainer fill:#90EE90,stroke:#000,stroke-width:2px;
    classDef file fill:#E0E0E0,stroke:#000,stroke-dasharray: 2 2;
    classDef viewport fill:#FFA500,stroke:#000;
    classDef user fill:#FFFFFF,stroke:#000,shape:circle;
```
