英文:
CSS.Is is posible to place one element at center of flexbox and one at the right side (large screen) ; but both at center in column in mobile devices?
问题
将内容放入 flexbox 中,以使在较大的显示屏上查看时两个单元格并排显示,但在较小的屏幕上(即移动设备)查看时,将这两个元素都居中于视口中,这样可以使我的Web应用程序更具响应性吗?
例如,
- 在较大的屏幕/视口上,应如下所示:
- 在较小的屏幕/视口上(即移动设备),应如下所示:
谢谢大家。我搞不定。
英文:
Is it possible to make my web app more responsive by placing content in a flexbox such that two cells are side-by-side when viewed on larger displays, but then have both of these elements centered in a single column in the viewport when viewed on smaller screens (i.e., mobile devices)?
For example,
- On larger screens/viewports it should look like this:
- On smaller screens/viewports (i.e., mobile) it should look like this:
Thank you all. I can't figure it out.
答案1
得分: 0
使用媒体查询
@media (max-width: 600px)
并设置
flex-direction: column
英文:
Use a media-query
@media (max-width: 600px)
and set
flex-direction: column
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论