Skip to content

diegodevtech/travelgram

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Travelgram — HTML & CSS Highlights

Travelgram is a single-page profile and gallery that showcases a travel creator using semantic HTML and modern, modular CSS.


Structure

  • HTML

    • <!DOCTYPE html>, <html lang="en">, <meta charset="UTF-8">, and viewport meta for standards mode and responsiveness.
    • Semantic sections: <nav>, <header>, <main>, <footer>, plus utility wrappers like .container and .bg-surface-color.
    • Navigation with a list-based primary menu, logo link, and profile avatar.
    • Profile header with image, bio, and an info list (#info) for location, countries, and photo count.
    • Gallery of images in <main>, all using loading="lazy" for performance.
  • CSS files

    • styles/index.css: imports all section styles (globals, nav, header, main, footer).
    • globals.css: reset, CSS variables (colors, typography), base body, a, img, and .container.
    • nav.css, header.css, main.css, footer.css: layout and responsive rules per page section.

Key HTML Techniques

  • Semantic layout elements instead of generic divs wherever possible.
  • Descriptive alt text on all images and icons.
  • Lazy-loaded gallery images (loading="lazy") to reduce initial load time.
  • External Google Fonts (Poppins, 400/700) with preconnect hints for faster font loading.

Key CSS Techniques

  • Design tokens with CSS variables

    • Colors (--brand-color, --surface-color, text colors, etc.) and a type scale (--text-lg, --text-md, --text-base, --text-sm) defined in :root.
  • Layout

    • .container for centered, max-width layouts with horizontal padding.
    • Flexbox used throughout:
      • nav: horizontal alignment of logo and menu, avatar sizing with object-fit: cover and border-radius: 50%.
      • header: two-column layout for profile and info; #profile as a flex row with gaps.
      • main: wrapping image grid using display: flex, flex-wrap: wrap, and gap.
      • footer: flex row with margin-right: auto on the first span to split content left/right.
  • Gallery styling

    • Square tiles via aspect-ratio: 1 / 1, object-fit: cover, and rounded corners.
  • Global styling

    • Reset via * { margin: 0; padding: 0; box-sizing: border-box; }.
    • Links styled to inherit color, with hover state changing to brand color and adding underline.
    • Images constrained with max-width: 100% and display: block for responsive behavior.

Responsive Design

  • Single breakpoint at max-width: 768px used across styles:
    • nav: wraps content and tightens gaps.
    • header: stacks columns, shrinks avatar size, makes #info a wrapping, two-column flex row.
    • main: centers the gallery and caps image width with width: min(100%, 16rem).
    • footer: switches to a vertical stack with left-aligned items.
    • .container: reduces horizontal padding for smaller screens.

Running the Project

  • Open index.html directly in a browser

About

An Instagram-like app to highlight travels

Topics

Resources

Stars

Watchers

Forks

Contributors