GithubHelp home page GithubHelp logo

Comments (5)

ddztomcat avatar ddztomcat commented on June 21, 2024
在 1920px*1080px 的屏幕分辨率下
1920px = 100vw
1080px = 100vh
以一个宽 300px 和 200px 的 div 来说,其所占的宽高,以 vw 和 vh 为单位,计算方式如下:
vwDiv = (300px / 1920px ) * 100vw
vhDiv = (200px / 1080px ) * 100vh

能达到这种效果吗

from postcss-mobile-forever.

wswmsword avatar wswmsword commented on June 21, 2024

现在是没这个特性的,这个有应用场景吗?我还没见过这种开发模式。。。

from postcss-mobile-forever.

ddztomcat avatar ddztomcat commented on June 21, 2024

现在是没这个特性的,这个有应用场景吗?我还没见过这种开发模式。。。

开发pc大屏时,假如设计稿1920*1080,比例是 16/9 的,那么在某些比例大于 16/9 的屏幕上,如果在竖直方向也是采用vw的话,可能会导致y方向出现滚动条,理想是y方向按照(设计稿宽带/ 1080px ) * 100vh

from postcss-mobile-forever.

wswmsword avatar wswmsword commented on June 21, 2024

设计稿 1920*1080,如果一个放在 1920*1080 屏幕上的,尺寸是 100*100 的正方形,换成 1920*2000 的屏幕,按照您提供的计算方法 vhDiv = (100px / 1080px ) * 100vh,结果是 9.26vh,经过浏览器的转换,会得到一个 100*185.2 的长方形,这就不是原来的正方形了。
你这个是数字大屏吗,可以试试这几个库:

from postcss-mobile-forever.

ddztomcat avatar ddztomcat commented on June 21, 2024

设计稿 19201080,如果一个放在 19201080 屏幕上的,尺寸是 100100 的正方形,换成 19202000 的屏幕,按照您提供的计算方法 vhDiv = (100px / 1080px ) * 100vh,结果是 9.26vh,经过浏览器的转换,会得到一个 100*185.2 的长方形,这就不是原来的正方形了。 你这个是数字大屏吗,可以试试这几个库:

有道理

from postcss-mobile-forever.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.