0 votes
261 views
in HTML by (2.2k points)
edited
How do you adjust the width of the columns for different screen sizes using CSS media queries?

1 Answer

0 votes
by (98.9k points)
edited

You can adjust the width of the columns for different screen sizes using CSS media queries and specifying different widths for each screen size. Here's an example:

 

@media (max-width: 768px) {
  .column {
    width: 100%;
  }
}

@media (min-width: 769px) and (max-width: 1200px) {
  .column {
    width: 50%;
  }
}

@media (min-width: 1201px) {
  .column {
    width: 33.33%;
  }
}

In this example, the CSS code sets different widths for the columns based on screen sizes. Columns will occupy 100% width on screens up to 768 pixels, 50% width on screens between 769 and 1200 pixels, and 33.33% width on screens larger than 1200 pixels.

 

Related questions

0 votes
1 answer 118 views
0 votes
1 answer 160 views
0 votes
1 answer 130 views
0 votes
1 answer 153 views
0 votes
1 answer 177 views
asked Jun 12, 2023 in HTML by radhe (2.2k points)
0 votes
1 answer 157 views

Doubtly is an online community for engineering students, offering:

  • Free viva questions PDFs
  • Previous year question papers (PYQs)
  • Academic doubt solutions
  • Expert-guided solutions

Get the pro version for free by logging in!

5.7k questions

5.1k answers

108 comments

606 users

...