A collection of HTML and CSS layout designs for experimentation and learning modern CSS techniques.
- Multiple layout patterns — cards, navbars, grids, hero sections, forms
- Responsive design — mobile-first approach with media queries
- CSS techniques — flexbox, CSS Grid, transitions, and animations
- Clean, commented code — easy to understand and reuse
- Simple components — ready-to-use UI elements
github_UI_CSS/
├── index.html # Main entry point
├── css/ # Stylesheet files
│ ├── styles.css
│ └── layout.css
├── assets/ # Images, fonts, icons
└── README.md # Documentation
- Clone the repo:
git clone "https://github.com/Aniketgudgal/CSS.git" - Open in VS Code:
File > Open Folder... > d:\github_UI_CSS
- Preview designs:
- Install Live Server extension
- Right-click HTML file → "Open with Live Server"
- Deployed demo:
- Responsive card layouts
- Navigation bars (sticky, dropdown)
- Grid-based designs
- Flexbox-based layouts
- Forms with styling
- Hero sections
The repository contains several example folders demonstrating Grid and Flex techniques. Key folders include:
-
Grid examples:
- grid_template_1 — basic multi-area grid demo (header, slider, content blocks, footer). Readme: grid_template_1/README.md
- grid_template_3 — contact/hero layout using named grid areas and a two-column contact section. Readme: grid_template_3/README.md
- grid_template_4 — one-column grid with nested header grid and hero background. Readme: grid_template_4/README.md
-
Flex examples:
- Layout_Design_In_Flex — multi-band page demonstrating nested flex containers and article cards. Readme: Layout_Design_In_Flex/README.md
- Layout_design — additional flex-based examples and page components. Readme: Layout_design/README.md
-
Responsive design — one-column grid with nested header grid and hero background. Readme: Responsive Layout
Each example folder contains an index.html, stylesheets (usually in a css/ folder), and images in an img/ folder. Open the folder and view index.html in a browser (or use Live Server) to preview.
Adding screenshots
Many examples include preview images in their img/ folders and README files. If you want me to add or replace screenshots for specific examples, tell me which folder(s) and provide the image(s) or confirm that placeholders are acceptable.
This repository follows a mobile-first, responsive design approach. Below are concise guidelines and best practices to help you build or adapt layouts in this collection:
- Mobile-first: write base styles for small screens, then layer larger-screen styles inside
@media (min-width: ...)queries. - Common breakpoints (adjust to your needs):
@media (min-width: 480px)— small / large phones@media (min-width: 768px)— tablets / landscape phones@media (min-width: 1024px)— small desktops@media (min-width: 1200px)— large desktops
- Grid: redefine
grid-template-columnsandgrid-template-areasinside media queries to change column counts and content placement across sizes. - Flex: use
flex-wrap,flex-basis, andgapto let items reflow; changeflex-directionon narrow screens to stack items vertically. - Images: prefer
background-size: coverfor hero images, and useimg { max-width: 100%; height: auto; }for inline images. - Typography & touch targets: increase font sizes, line-height, and clickable area (
padding) at smaller sizes for readability and accessibility. - Testing: use browser DevTools (device toolbar) and a real device where possible; test orientation changes and different DPRs.
Example media-query pattern (mobile-first):
/* base (mobile) */
.cards { display: flex; flex-direction: column; gap: 1rem; }
/* larger screens */
@media (min-width: 768px) {
.cards { flex-direction: row; flex-wrap: wrap; }
.card { flex: 1 1 calc(33.333% - 1rem); }
}If you'd like, I can add the above guidance and examples into each example folder's README (for grid/flex examples) so each demo contains its responsive notes. Tell me which folders to update and I will apply consistent guidance.
- Report bugs or suggest improvements via Issues
- Fork → Create branch → Make changes → Submit PR
MIT License