Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在设计一个用户界面网页,该网页将通过设备的浏览器在移动设备上查看。设计两个界面,一个是纵向的,一个是横向的,是不是很常见?纵向视图看起来不错,但是当我翻转到横向时,事情当然会被拉伸。这里有关于最佳实践的想法吗?
为不同的窗口方向设计两个界面是一种常见的做法。检查窗口方向。
//Listen for resize changes window.addEventListener("resize", function() { // Get screen size (inner/outerWidth, inner/outerHeight) }, false);
每次更改时,将纵向和横向模式的不同 CSS 类应用到网页上的元素。