[英]Responsive screen size
Is there a way/code that I can us to make website fit all screen sizes without using media query in the CSS?
有没有一种方法/代码可以使网站适合所有屏幕尺寸,而无需在CSS中使用媒体查询?
The style that I am using is the CSS Style, not bootstrap nor flexbox
我使用的样式是CSS样式,不是引导程序也不是flexbox
You can use vh
(1% of window height) and vw
(1% of window width) units in your CSS definitions instead (and calc(...)
desired values). 您可以在CSS定义中使用
vh
(窗口高度的1%)和vw
(窗口宽度的1%)单位(以及calc(...)
所需的值)。
Btw. 顺便说一句。 flexbox is CSS style and is the next thing you may consider.
flexbox 是 CSS样式,是您可能要考虑的下一件事。
you can use 您可以使用
width:100%
in your css file for responsive design then it will fixed but if you have 4 div and then you need to use 25% or less. 在您的css文件中进行响应式设计,它将修复,但是如果您有4 div,则需要使用25%或更少的值。 it will work all section but if it is mobile device then total screen size is 500px as like then when you use
它将适用于所有部分,但如果是移动设备,则总屏幕尺寸为500px,就像您使用时
width:25%
then 4 div will show very small size and it will not good to see this so if you use media query then it will look fine .
然后4 div将显示非常小的尺寸,因此看不到它很好,因此,如果您使用媒体查询,它将看起来很好。 but percent (%) will work for your purpose
但是百分比(%)可以满足您的目的
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.