Giter Site home page Giter Site logo

Comments (1)

LarryZhu-dev avatar LarryZhu-dev commented on June 2, 2024 2

很多人有这个疑惑,我这里统一说明一下:autofit.js只干了一件事,就是对最外层容器(默认是body)设置了宽高(px)和缩放(scale),你可以先新建一个空白项目来尝试理解。
在拖动浏览器窗口大小时,autofit.js 也会同时设置合适的宽高和缩放值,使body始终充满屏幕,至于body内部的元素该使用什么单位编写,完全取决于实际情况,但是 不可以使用 rem/vh/vw 等相对单位 。autofit.js 推荐使用 px 和 % ,当你需要一个固定宽高的元素,比如一个天气图标 image ,你就应该使用 px。当你需要一个需要跟随屏幕大小变化而变化的元素,比如常见大屏左右两侧的盒子,你就需要使用 %。

from autofit.js.

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.