HTML/CSS Responsive

Integration - part II

Responsive design workshop

The objectives of this workshop:
• improve the HTML integration with Flex and Grid properties.
• make the whole thing responsive.

Initialisation

This workshop is the second part of the HTML Basics workshop. So you can start from your previous work or download this version if you are not sure of what you did.

Layout of your website

You will have to create a basic responsive website following the layout below (do not try to be pixel perfect, this image is just a guide).

Open in new tab
Layout to reproduce

(The screenshot has been made at 360px viewport width, it is a standard smartphone size).

Reminder:
Video - Flexbox in 100s
Flexbox basics Cheatsheet

Unlike the About Us section which doesn’t need to be modified here, the Featured posts section requires you to add a css class to it.

Reminder: CSS Grid basics in 5 minutes.

Tips: the first article can be targeted with the :first-of-type css selector.

Make it responsive

Add media queries and use CSS functions to obtain the responsive layout below at 1200px.

You can use a breakpoint at 768px in your media queries (which is a landscape breakpoint of some tablets).

Open in new tab Layout to reproduce

(The screenshot has been made at 970px viewport width.)

Tips: add this code snippet to your css so that the <h2> is positioned in a friendly way 😏 .

section.featured-posts h2 {
   grid-column: 1 / -1;
}