0 votes
98 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 51 views
0 votes
1 answer 92 views
0 votes
1 answer 56 views
0 votes
1 answer 76 views
0 votes
1 answer 103 views
asked Jun 12, 2023 in HTML by radhe (2.2k points)
0 votes
1 answer 83 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

535 users

...