Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vw做的适配网站怎么设置最大宽度 #4

Open
xian107 opened this issue Sep 17, 2018 · 7 comments
Open

vw做的适配网站怎么设置最大宽度 #4

xian107 opened this issue Sep 17, 2018 · 7 comments

Comments

@xian107
Copy link

xian107 commented Sep 17, 2018

比如当视窗宽度大于768,就给html或body设置一个最大宽度,然后margin:auto;请问这个怎么解决
image

@xian107
Copy link
Author

xian107 commented Sep 17, 2018

@airen 望大神指点

@lod61
Copy link

lod61 commented Sep 30, 2018

@airen 望大神指点

我说下我的理解,在使用vw的时候,如果出现上面这样的情况,就会需要根据项目实际情况来判断了,如果是需要设计成pc端的,那就没必要用这个方法来写,不然就这样。它的样式也会根据宽度自适应。因为viewportWidth 就是整个屏幕的宽度。

@kid1412621
Copy link

@liuqianghui 那 PC 和 mobile 是要分别打包吗?

@lod61
Copy link

lod61 commented May 4, 2019

@liuqianghui 那 PC 和 mobile 是要分别打包吗?

分情况吧,如果是写了2份的话,就需要打包成2个了,如果是用mobile screen做适配的话,不需要了。不过如果是用vw的话,一般是用来做移动端方便适配吧。我就一般这么用😁

@kid1412621
Copy link

kid1412621 commented May 6, 2019 via email

@lod61
Copy link

lod61 commented May 8, 2019 via email

@wswmsword
Copy link

@xian107 嗨,限制最大宽度可以用 postcss-mobile-forever

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants