什么是HTML中的视口。 [英] What is viewport in HTML.

查看:674
本文介绍了什么是HTML中的视口。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

HTML中的视口是什么?你可以举一些关于如何访问视口细节的例子吗?

What is viewport in HTML? Could you give some examples on how to access the viewport details?

推荐答案

视口是网页的一部分,用户可以目前看到。滚动条移动视口以显示页面的其他部分。

The viewport is the part of the webpage that the user can currently see. The scrollbars move the viewport to show other parts of the page.

按照这篇文章的说明在Javascript中获取视口尺寸

if (typeof window.innerWidth != 'undefined')
 {
      viewportwidth = window.innerWidth,
      viewportheight = window.innerHeight
 }

这篇关于什么是HTML中的视口。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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