Click here to Skip to main content
15,891,423 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
i have designed a responsive website that works fine in windows browser on pc but it shows extra horizontal space at right side in tablet mode or in mobile width
how can i remove this because overflow-x:hidden is not working there.
Posted
Updated 7-May-15 2:08am
v2

1 solution

Hi,

I had this issue when using bootstrap. Have you tried using media queries to define a mobile and tablet screen size? For example

CSS
/* ----------- iPhone 6 ----------- */

@media screen and (max-width: 375px) {
    body {
        overflow: hidden;
    }
}

/* ----------- iPad mini ----------- */

@media screen and (max-width: 768px) {
    body {
        overflow: hidden;
    }
}


You could also consider adding an !important tag to the media query rules in order to overwrite any other CSS that may be causing this.

CSS
/* ----------- iPhone 6 ----------- */

@media screen and (max-width: 375px) {
    body {
        overflow: hidden!important;
    }
}

/* ----------- iPad mini ----------- */

@media screen and (max-width: 768px) {
    body {
        overflow: hidden!important;
    }
}


See this url for all media query px sizes - https://css-tricks.com/snippets/css/media-queries-for-standard-devices/[^]


Hope this helps!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900