Comments (2)
-
设计师的尺寸一般是像素尺寸,我们前端遇到二倍或者三倍屏幕要除2 除3 是很正常的,我们一直是这样去写的
-
如果用到了其他的外部库,可以把外部库的 css 改成 less 之后 import 进去。
from tmt-workflow.
哈哈,我是看到 小程序使用 rpx 作为单位
新增了尺寸单位。在写 CSS 样式时,开发者需要考虑到手机设备的屏幕会有不同的宽度和设备像素比,采用一些技巧来换算一些像素单位。WXSS 在底层支持新的尺寸单位 rpx ,开发者可以免去换算的烦恼,只要交给小程序底层来换算即可,由于换算采用的浮点数运算,所以运算结果会和预期结果有一点点偏差。
rpx(responsive pixel): 可以根据屏幕宽度进行自适应。规定屏幕宽为750rpx。如在 iPhone6 上,屏幕宽度为375px,共有750个物理像素,则750rpx = 375px = 750物理像素,1rpx = 0.5px = 1物理像素。
建议: 开发微信小程序时设计师可以用 iPhone6 作为视觉稿的标准。
我是不是太懒了,什么都想用现成的![笑cry]
from tmt-workflow.
Related Issues (20)
- 关于目录结构 HOT 2
- 目前微信仍然使用吗 HOT 1
- 适配node 8.0 以上版本 HOT 1
- node-sass error HOT 1
- build-dist reversion 报错 HOT 1
- EJS include 无效 HOT 3
- npm install 报错 HOT 2
- 希望能增加ES6转es5的功能 HOT 1
- 如何将index.html 提到 html 目录之外 HOT 1
- 修复雪碧图一倍的时候,修改html:font-size != 20px,时,雪碧图位置显示不正确。 HOT 4
- 修改项目构建生成时的模板 HOT 1
- 请教下1.5.7中,如果js目录中有插件(含样式图片)的话,dev和dist命令改如何修改? HOT 1
- bem规范介绍应该是--不是__ HOT 1
- npm install 报错 HOT 4
- 可以添加es6解析吗? HOT 1
- TypeError [ERR_INVALID_CALLBACK]: Callback must be a function HOT 3
- gulp build_dist之后样式的二级目录都没有了 HOT 1
- 需要给页面传参,引入了gulp-data这样写结果报错
- 关于BEM规范 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tmt-workflow.