What is viewport in HTML.

前端 未结 5 1433
栀梦
栀梦 2020-11-30 21:59

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

5条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-11-30 22:43

    I think the ViewPort is just an area to display the web content in the browser. And different browsers have their own setting for the size of ViewPort, For example, the default ViewPort width of Safari is 980 pixels. So, if the actual web page you want to see is smaller than 980 pixels, there should be a blank display area in the Safari when accessing the web page in the Safari by default. Hence, that is the reason sometimes we need to configure the ViewPort for better web content display in the browser.

    Like below, for example:

    
    

    And also please read Paul's answer. I think he already explained the usage of ViewPort.

提交回复
热议问题