css获取屏幕分辨率的高度 [英] css get height of screen resolution
问题描述
因为我的朋友有1024x768分辨率,当他检查我的工作进入他的电脑,它的一切搞砸,这是我谈到CSS的高度和宽度的唯一的问题。
不可能从CSS获得屏幕的高度。但是,使用CSS3后,您可以使用媒体查询来控制模板的显示
如果您想使用媒体查询以高度为基础进行编码,您可以定义样式表并像这样调用。
< link rel =stylesheetmedia =screen and(device-height:600px)/>
im having a hard time getting the height of lower screen resolution because my screen resolution is 1920x1080 does anyone know how to get the height and width screen resolution? because my friend has 1024x768 resolution when he checked my work into his computer, its all messed up, this is my only problem when it comes to CSS the height and width.
It is not possible to get the height of the screen from CSS. However, using since CSS3 you can use media queries to control the display of the template as per the resolution.
If you want to code on the basis of height using media queries, you can define style-sheet and call it like this.
<link rel="stylesheet" media="screen and (device-height: 600px)" />
这篇关于css获取屏幕分辨率的高度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!