简体   繁体   English

根据屏幕尺寸未显示DIV标签

[英]DIV Tag is not displaying according to the screen size

DIV Tag is not displaying according to the screen size. 根据屏幕尺寸未显示DIV标签。 I am using jquery mobile for mobile application. 我正在将jQuery mobile用于移动应用程序。 In that using DIV Tag to display the Map according to the screen size. 使用DIV Tag根据屏幕尺寸显示地图。 The coding is as follows: 编码如下:

<div id="map_canvas" style="width:100%; height:417px;"></div> 

When i remove the style attribute of the DIV Tag it not display the map on the screen 当我删除DIV标签的样式属性时,它不会在屏幕上显示地图

Please help me... 请帮我...

<div id="map_canvas" style="width:100%; height:417px;"></div>

I assume when you say it isn't displaying the same as your screen size you are talking about the height and not width. 我认为当您说它显示的屏幕尺寸与您的屏幕尺寸不同时,您是在说高度而不是宽度。 In your style tag you have the height set to 417px, if you want the div to fill the entire screen you need to set this to 100% just like the width part is. 在样式标签中,您将高度设置为417px,如果您希望div填充整个屏幕,则需要将其设置为100%,就像宽度部分一样。

<div id="map_canvas" style="width:100%; height:100%;"></div>

When i remove the style attribute of the DIV Tag it not display 当我删除DIV标签的样式属性时,它不会显示

Right. 对。 If you don't explicitly set a height and there's nothing in the div to force a height, then you won't see it, as it has a height of zero. 如果您没有明确设置高度,并且div中没有​​强制设置高度的内容,那么您将不会看到它,因为它的高度为零。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM