DIV Tag is not displaying according to the screen size. I am using jquery mobile for mobile application. In that us开发者_StackOverflow社区ing 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.
精彩评论