2

I am working on Windows Phone 8 Mobile application which uses IE10 browser internally.

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 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. 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. it results in blank white space at the bottom of childDiv2. I am trying to remove the blank white space but no work around seems helping so far. Any help will be appreciated. Thanks.

Pravesh Pesswani
  • 481
  • 8
  • 16
  • please create a fiddle for you code.. – AurA Jul 31 '13 at 04:55
  • Have you tried to force a display:none whenever your innerHTML is empty? The blank space is probably caused by the natural padding/margin of the div-element. Another possibility is to force margin and padding to be 0; – Miraino Hikari Apr 08 '14 at 19:25
  • Nothing about your question is specific to HTML 5. Since this is almost certainly a CSS issue, you should retag and retitle it as such. –  Jun 26 '14 at 17:37

1 Answers1

1

White space can be caused by many things in 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.

  2. Sometimes Internet Explorer adds space in an empty div because of font. Try to add font-size: 0 to prevent that.

Tyler
  • 3,713
  • 6
  • 37
  • 63
  • 1
    I achieved the same result by using `line-height : 0` CSS property, if for some reason using `font-size : 0` caused many other issues with child elements (like in my case). – Norman Breau Aug 03 '17 at 17:19