← All learning materials
Frontend & Layouts · 25 MIN READ · DEVELOPER GUIDE

Build responsive pages with HTML and CSS

Create equal-height cards, proportional images and readable mobile layouts.

Learning progress is saved in this browser when local storage is available.

Use meaningful HTML

Use a header for site identity, nav for primary links, main for page content and article for each independent resource card. Label search inputs and use buttons for actions. Heading order gives readers and assistive technology a useful outline.

Arrange cards with CSS Grid

Use repeat(3, minmax(0, 1fr)) for equal columns. minmax(0, 1fr) allows long content to shrink without pushing the page wider. Switch to two columns on tablets and one on phones. Consistent image aspect ratios keep the card rows aligned.

Keep images natural

Use object-fit: cover to crop an image to a frame while preserving proportions. Use contain when the full artwork must remain visible. Do not use independent stretched width and height or background-size: 100% 100%. Check small text, focus states and overflow at mobile sizes.

Syntax in practice

A focused learning example. Read the referenced source file for its full application context.

.resource-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.resource-cover img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
@media (max-width: 650px) { .resource-grid { grid-template-columns: 1fr; } }
PUT IT INTO PRACTICE

Try it yourself

Inspect an image at desktop and mobile sizes and explain the difference between cropping and stretching.

Work on a development copy, then explain what changed and how you verified it.

Project file map

Find these paths in your local WebsHigher checkout. Source paths are references, not public downloads of application code.

  • assets/css/travel-subcategory-layouts.css
  • assets/css/studio-pricing.css

Keep learning

Start here: the WebsHigher codebase →Run the project locally →PHP syntax and reusable page components →
Get Started