This project recreates Piet Mondrianβs "Composition" tableau (with red, yellow, blue, black, and white rectangles) using only HTML & CSS.
It demonstrates the use of CSS Grid, Flexbox, and positioning to transform abstract art into clean, semantic code.
π GitHub Pages Link
| Original Artwork | CSS Version |
|---|---|
![]() |
![]() |
- HTML5 β semantic structure
- CSS3 β Grid & Flexbox layout
- Modern Normalize β for consistent cross-browser rendering
mondrian-css/
βββ index.html
βββ css/
β βββ styles.css
βββ images/
β βββ mondriancomposition.jpg # reference painting
β βββ vscodescreenshot.png # CSS output screenshot
- Pixel-perfect recreation of Mondrianβs rectangular composition
- Responsive grid: adapts to different screen sizes
- Minimalist CSS without any JavaScript
- Adjustable colors & sizes β experiment with new layouts!
- Black grid lines are built using CSS
background*colorand grid gaps - Colored blocks (red, yellow, blue, white) are placed as grid items
- Each rectangle is given specific width Γ height in px, inspired by the original painting
- Layout can be easily modified to create other Mondrian-style artworks
This project is based on Piet Mondrianβs "Composition C, No. III, with Red, Yellow and Blue" (1935). It reflects the De Stijl art movement: simplicity, abstraction, and harmony through primary colors and geometry.
This project is licensed under the MIT License. Artwork reference Β© by Piet Mondrian (public domain).

