HTML, CSS & JavaScript Examples

Learn web development through interactive tutorials and use copy-paste landing page templates for your SaaS or side project.

Web Development Tutorials

46 tutorials

Browse all tutorials · Interactive examples with copy-paste ready code snippets. Pure HTML, CSS & vanilla JS. No frameworks needed.

CSS Corner Shapes

Learn border-radius, clip-path, and the new corner-shape CSS property.

View tutorial
Sticky
Rel
Abs
Fix

CSS Position Property

Master relative, absolute, fixed, sticky positioning with visual examples.

View tutorial

CSS Flexbox

Learn flex-direction, justify-content, align-items, and more.

View tutorial

CSS Grid

Master grid-template, auto-fit, minmax, and grid areas.

View tutorial

CSS Animations

Create transitions, @keyframes, and timing functions.

View tutorial

CSS Transforms

Learn translate, rotate, scale, and 3D transforms.

View tutorial

CSS Card Designs

Build hover effects, flip cards, glassmorphism, and gradient borders.

View tutorial

HTML Form Styling

Style inputs, checkboxes, radio buttons, selects, and validation.

View tutorial

CSS Shadows

box-shadow, text-shadow, drop-shadow(), layered shadows & neumorphism.

View tutorial

CSS Gradients

linear-gradient, radial-gradient, conic-gradient, gradient text & borders.

View tutorial
LIGHT · DARK

Dark Mode

prefers-color-scheme, CSS variables, JS toggle & localStorage persistence.

View tutorial

CSS Navigation

Navbars, dropdowns, hamburger menus, breadcrumbs & pagination.

View tutorial

CSS Tables

Zebra striping, hover effects, sticky headers & responsive tables.

View tutorial

Pseudo-elements

::before & ::after for badges, tooltips & decorations.

View tutorial

CSS Variables

Custom properties, theming, calc() & design tokens.

View tutorial
Aa Playfair Fira Code

CSS Typography

Master font-size, line-height, clamp(), and modern text decoration.

View tutorial

Scroll Animations

scroll-snap, scroll-driven animations, IntersectionObserver reveals & parallax.

View tutorial

Filters & Blend Modes

filter, backdrop-filter, mix-blend-mode & image effects.

View tutorial

Container Queries

@container, container-type, container units & responsive components.

View tutorial
:has() :is()
:not() :where()

Modern Selectors

:has(), :is(), :where(), :not(), combinators & :nth-child.

View tutorial
1rem clamp() vw vh ch

Units and Fluid Sizing

Learn rem, em, viewport units, ch, and clamp() for responsive sizing.

View tutorial

Aspect Ratio and Media Fit

Build stable image and video layouts with aspect-ratio, object-fit, and object-position.

View tutorial

Media Queries & Responsive Design

Learn CSS media queries and mobile-first responsive design. Interactive breakpoint examples, min-width vs max-width, and

View tutorial

How to Center in CSS

Center divs horizontally and vertically with flexbox, grid, margin auto, and transform. Interactive CSS centering exampl

View tutorial

Logical Properties & RTL

Learn CSS logical properties for RTL and LTR layouts. margin-inline, padding-inline, inset, and writing-mode with intera

View tutorial
SkipFocus

Accessible CSS Patterns

Build accessible interfaces with CSS: focus-visible rings, skip links, contrast, and prefers-reduced-motion. Copy patter

View tutorial

Text Overflow & Line Clamp

Truncate text with text-overflow ellipsis and -webkit-line-clamp. Fix overflow in cards, tables, and responsive layouts.

View tutorial

CSS Scroll Snap

Learn scroll-snap-type and scroll-snap-align for carousels, galleries, and paginated horizontal lists without JavaScript

View tutorial

Viewport Units for Mobile

Fix mobile 100vh bugs with dvh, svh, and lvh. Learn safe-area-inset for notched phones and full-screen heroes.

View tutorial

Button Hover & Focus States

Style button hover, active press, focus-visible, and disabled states.accessible, consistent CTAs with copy-ready CSS.

View tutorial

Modals & Overlays

Build accessible modals with the dialog element, fixed overlays, backdrop blur, and scroll locking patterns.

View tutorial

Accordion & Tabs

Build accordions with details/summary and accessible tab UIs with CSS-only panel switching patterns.

View tutorial

Sticky Headers

Keep headers visible with position sticky, top offsets, z-index stacking, and scroll-driven shadow effects.

View tutorial

Skeleton Loading UI

Skeleton screens reduce perceived wait time. Build shimmer gradients and pulse placeholders with pure CSS.

View tutorial

OKLCH Color Spaces

Use OKLCH and color-mix for perceptually uniform palettes, safer gradients, and wide-gamut displays.

View tutorial

Cascade Layers & Specificity

Control the cascade with @layer, tame specificity using :where(), and organize resets, tokens, and components.

View tutorial
navmainfooter

Semantic HTML

Use semantic HTML for accessibility and SEO: header, nav, main, article, section, aside, and footer landmarks.

View tutorial
<meta name="og:title">

HTML Meta & SEO Tags

Essential meta tags for SEO and social sharing: title, description, canonical, Open Graph, and Twitter cards.

View tutorial

Responsive Images & Lazy Load

Serve correct image sizes with srcset and sizes; defer offscreen images with loading=lazy and fetchpriority.

View tutorial

HTML Form Validation

Client-side validation with HTML5 attributes and style :valid/:invalid. Accessible error messages with setCustomValidity

View tutorial
div
pspan

DOM Basics

Learn DOM manipulation: select elements, change text and classes, create nodes, and append to the tree.

View tutorial

Event Delegation

Handle events on dynamic lists by listening on a parent and inspecting event.target.

View tutorial
{ "ok": true }

Fetch API Basics

Load JSON from APIs with fetch, await response.json(), check response.ok, and handle network errors.

View tutorial
theme: dark

localStorage

Persist UI preferences and small data with localStorage. Serialize JSON safely and handle quota errors.

View tutorial

Clipboard API

Copy text to the clipboard with the async Clipboard API and fallbacks for older browsers.

View tutorial

Progressive Enhancement

Use @supports feature queries and fallbacks to deliver modern CSS safely.

View tutorial

Why Learn With Our Examples

Copy-Paste Ready

Every code snippet includes a copy button. Use the code directly in your projects.

Visual Demos

See exactly how HTML, CSS, and JavaScript work together with live examples.

Mobile Friendly

All examples are responsive and work on any device or screen size.

Free Web Development Tutorials & Landing Page Templates

Our collection of HTML, CSS, and JavaScript tutorials helps beginners and intermediate developers learn modern web development techniques. Each tutorial includes working code snippets, visual demonstrations, and clear explanations. The Landing Page Gallery offers copy-paste ready, single-file HTML templates for indie hackers and SaaS founders. Validate your idea with a live page in minutes. No frameworks needed, just pure HTML, CSS, and vanilla JavaScript.

The tutorials cover essential CSS topics including Flexbox and CSS Grid layout systems, CSS animations with @keyframes and transitions, responsive design with container queries, custom properties via CSS variables, and modern selectors like :has(), :is(), and :where(). Every example is self-contained with copy-paste code that works in any project.

The landing page templates are single-file HTML pages styled with Tailwind CSS. Each template features a unique visual identity, from glassmorphism and neon gradients to retro shadows and editorial layouts. Designed for indie hackers, solo founders, and weekend builders who need a polished page without build tools or dependencies.

Frequently asked questions

What is the Web Examples Gallery?
Web Examples Gallery (this site) is a curated set of hands-on HTML, CSS, and JavaScript tutorials together with copy-paste landing page templates for SaaS and side projects. Tutorials use live demos and short explanations; templates are single-file pages you can open locally or deploy as static HTML, ideal when you want to validate an idea before investing in a full stack.
Are the code examples and templates free?
Yes. Everything here is built for learning and for shipping small projects quickly. You can copy snippets into your own work; if you republish entire files publicly, follow the same courtesy you would with any open educational resource (attribution where it makes sense, and respect any license noted in the repo).
Do I need a JavaScript framework or a build tool?
No. The tutorials emphasize vanilla JS and modern CSS. Landing templates often rely on the Tailwind CSS CDN, so you do not need npm or a bundler to preview or host them. That keeps the examples easy to read for beginners and fast to fork for a weekend launch.
Which CSS and layout topics are covered?
You will find dedicated pages for Flexbox, CSS Grid, animations, transforms, forms, filters, shadows, navigation, tables, pseudo-elements, CSS variables, scroll animations, dark mode, container queries, and advanced selectors (:has(), :is(), :where()). Together they cover most of what you need for responsive, modern front-end layouts.