0 votes
76 views
in HTML by (2.2k points)
edited
How do you stack the columns vertically on smaller screens using CSS?

1 Answer

0 votes
by (98.9k points)
edited

To stack the columns vertically on smaller screens, you can use CSS flex-direction. Here's an example:



@media (max-width: 768px) {
  .container {
    flex-direction: column;
  }
}

In this example, the CSS code applies a media query and sets flex-direction: column; to the container. This makes the columns stack vertically on screens with a maximum width of 768 pixels.

 

Related questions

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

...