CSS3软箱模型和固定长宽比 [英] CSS3 Flexible Box Model and Fixed Aspect Ratio

查看:102
本文介绍了CSS3软箱模型和固定长宽比的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所有我能找到的灵活盒子模型的例子展示了在水平方向或垂直方向上扩展的东西。

All the examples I could find of flexible box model show stuff expanding either in the horizontal direction or the vertical direction. I could not find out how to let things flexibly expand while maintaining a fixed aspect ratio.

推荐答案

我最近问过一个类似的问题一个W3C课程论坛,并得到了一个教练,菲尔阿切尔的深入答复。他建议使用SVG在缩放时保持宽高比,并且通过示例,它表明它在Web浏览器中运行良好,但在移动设备上效果不佳。有关详情,请参阅 http://philarcher.org/diary/2012/scalablesquares

I asked a similar question recently in a W3C course forum, and got an in-depth reply from one of the instructors, Phil Archer. He suggests using SVG to maintain aspect ratio while scaling, and also shows by example that it works well in web browsers, but not so well on mobiles. See http://philarcher.org/diary/2012/scalablesquares for more info.

这篇关于CSS3软箱模型和固定长宽比的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆