In the last two articles, we are creating a layout for the standard website by including various components we created while learning HTML and CSS. We have already added a header, navigation bar and content with 3 rows which are not responsive. So let's start today with making it responsive... Make it Responsive If we see at our layout of the content, it always shows 3 columns side by side(Although not in Codepen as they add their own code to make it responsive). We will now write a piece of code that will change it to only one column on smaller devices. @media (max-width: 1200px) { .column { width: 50%; } } @media (max-width: 600px) { .column { width: 100%; } } What will above code do? If the width of the browser window is less than 600 px, the width of each column is 100% so that only one column in each row. Similarly, if the width is less than 1200 px, the width of each column is 50% so that there will be two columns in each row.
The blog to help programmers to learn, experiment and understand new concepts.