2

I am using bootstrap responsive design, when viewing my webpage in iPad it results in empty whitespace at right side, i set width as device-width in viewport meta tag, how to remove empty whitespace?

I tried this, nothing works correctly

Community
  • 1
  • 1
M.R
  • 610
  • 2
  • 10
  • 34
  • 2
    Any chance you could share code? Or a link? – Jack Apr 08 '14 at 08:41
  • seems to be generic ipad issue – M.R Apr 18 '14 at 07:57
  • If you mean a big whitespace extending your page way beyond your viewport, I've seen that happen before too. Every time that happened, there was some element css which didn't behave properly. Often a combination including `width: 100%`, but I forgot the exact problem. I can help you if you have a link, or a dummy page (jsfiddle) so we can find what causes it. CSS solved it for me in the past. – nvreez Apr 18 '14 at 08:33
  • 1
    needless to say , can't fix design related problem without looking at design – Vivek Apr 18 '14 at 09:14

1 Answers1

0

White-space is a text char. Just make text invisible using font: 0/0 a;. Let me explain. Two examples with common HTML:

<div>
<!--White-space -->
<span>Some text here<span>
</div>

Example 1. With white-space on iPad(jsfiddle) with css:

div {
    background: red;
}

span {
    background: blue;
    color: #fff;
}

Example 2. Without white-space on iPad(jsfiddle) with css:

CSS:

div {
    background: red;
    font: 0/0 a;/*make text invisible for parent container with white-spaces*/
}

span {
    background: blue;
    color: #fff;
    font: 12px/normal Arial, sans-serif;/*set back font for child container*/
    display:inline-block;/*just for good render effect*/
}
Alex
  • 11,115
  • 12
  • 51
  • 64
  • I have a doubt where to add this code, I have multiple pages/div/span in my website, should i add font:0/0 a; on bootstrap navbar – M.R Apr 18 '14 at 04:25
  • Add `font:0/0 a;` to top parent node where you have a problem – Alex Apr 21 '14 at 06:31