css获取屏幕分辨率的高度 [英] css get height of screen resolution

查看:1054
本文介绍了css获取屏幕分辨率的高度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因为我的屏幕分辨率是1920x1080,有谁知道如何获得高度和宽度屏幕分辨率?
因为我的朋友有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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆