简体   繁体   中英

DIV Tag is not displaying according to the screen size

DIV Tag is not displaying according to the screen size. I am using jquery mobile for mobile application. In that using DIV Tag to display the Map according to the screen size. 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

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.

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

When i remove the style attribute of the DIV Tag it not display

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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