html - Expand div outside container - overflow-x mobile issue -


recently tried this method increase div background-color outside container.everything ok except applying overflow-x body ,on mobile browsers not working.i mean when swipe left still scrolling ( same effect can achieve on desktop if press right arrow on keyboard ) .so how can disable scrolling horizontally on mobiles when using method?

here jsfiddle: http://jsfiddle.net/kzgvl6ba/

here's example: html:

<body>     <article>         <div class="extendfull">full-width bars</div>     </article> </body> 

css:

body {     overflow-x: hidden; } article {     background-color: #dddddd;     border-left: 1px solid #ccc;     border-right: 1px solid #ccc;     display: block;     margin: 0 auto;     padding: 0 10px;     width: 60%; } div.extendfull {     background-color: #ccf;     border: 1px solid #66c;     font-size: 1.8em;     font-weight: normal;     padding-left: 3000px;     margin-left: -3000px;     padding-right: 3000px;     margin-right: -3000px; } 

thank you!

not sure if solution you're looking for, add container remove scroll right , have same result (i think...)

<body>     <div style="overflow-x: hidden">         <article>             <div class="extendfull">full-width bars</div>         </article>     </div> </body> 

fiddle


Comments

Popular posts from this blog

c++ - QTextObjectInterface with Qml TextEdit (QQuickTextEdit) -

javascript - angular ng-required radio button not toggling required off in firefox 33, OK in chrome -

xcode - Swift Playground - Files are not readable -