简体   繁体   English

HTML5-div底部的额外空白

[英]HTML5 - Extra white space at the bottom of div

I am working on Windows Phone 8 Mobile application which uses IE10 browser internally. 我正在使用内部使用IE10浏览器的Windows Phone 8移动应用程序。

I am trying to remove the blank white space from a child div, which is appearing if the previously opened child div's content is more than the currently open child div. 我正在尝试从子div中删除空白区域,如果先前打开的子div的内容大于当前打开的子div的内容,则会出现空白。

<div id="parentDiv" style="overflow-x:hidden">
<div id="childDiv1" style="overflow-x:hidden">Content in childDiv1 is greater than childDiv2</div> 
<div id="childDiv2" style="overflow-x:hidden"></div>
</div>

I have one parent div say with id parentDiv .. which contains 2 child div's.. say with id = childDiv1 and childDiv2 . 我有一个父div,其ID为parentDiv ..,其中包含2个子div的..即,其ID为childDiv1childDiv2 If I navigate to childDiv1 from any of my page in the application and from childDiv1 I am navigating to childDiv2 and since childDiv1's content is more than childDiv2's content. 如果我从应用程序中的任何页面以及childDiv1导航至childDiv1,则我将导航至childDiv2,因为childDiv1的内容比childDiv2的内容更多。 it results in blank white space at the bottom of childDiv2. 它导致childDiv2底部的空白区域。 I am trying to remove the blank white space but no work around seems helping so far. 我正在尝试删除空白区域,但到目前为止,似乎没有任何解决方法。 Any help will be appreciated. 任何帮助将不胜感激。 Thanks. 谢谢。

White space can be caused by many things in internet explorer. 空格可能是由Internet Explorer中的许多原因引起的。

Some options: 一些选项:

  1. Be sure to add margin/padding to 0 for all divs involved and then remove them one by one until you figure out where you actually needed it. 确保为所有涉及的div添加margin / padding到0,然后将它们逐个删除,直到找出实际需要的位置。

  2. Sometimes Internet Explorer adds space in an empty div because of font. 有时,Internet Explorer由于字体原因会在空的div中添加空间。 Try to add font-size: 0 to prevent that. 尝试添加字体大小:0以防止这种情况。

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

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