简体   繁体   English

响应式屏幕尺寸

[英]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.

相关问题 如何检测响应式网页设计的屏幕尺寸? - How to detect screen size for responsive web design? 显示当前屏幕大小 - 响应式设计工具 - Display current screen size - Responsive Design tools 响应式屏幕尺寸在小屏幕上播放 - Responsive screen size has play when on small screen CSS:响应式设计,位置卡可适合任何尺寸的屏幕中间 - CSS: responsive design, position card to fit in the middle any size of screen 更改屏幕尺寸时如何删除功能(菜单响应式) - How to remove function when I change screen size (menu responsive) 与屏幕宽度相关的图像渲染大小未知时的响应图像 - Responsive images when image rendering size in relation to screen width is unknown 缩小屏幕尺寸时如何在Css中使用响应设置重量和高度 - How to set weight and height in Css with responsive when reduce screen size 如何制作不同屏幕尺寸的响应式同位素库插件? - How to make a responsive isotope gallery plugin in different screen size? 如何使用 Phaser 3 为任何屏幕尺寸创建响应式游戏? - How to create a responsive game for any screen size with Phaser 3? 无论屏幕大小/宽度如何,我都希望将html表单保留在响应式幻灯片图像上 - I want to keep my html form over my responsive slideshow image regardless of the screen size/width
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM