html - margin-left, margin-right does not work in Android Browser -


consider code below:

 <!doctype html>  <html>  <body>  <div style="background-color: yellow; width: 100vw; height: 100vh; text-align: center;">     <button style="display: block; margin-left: auto; margin-right: auto;">this button</button>  </div>  </body>  </html> 

i tried run in chrome , mozilla, produces output below:

enter image description here

however, when tried run in android browser, button in left side, seems margin-left , margin-right doesnt work on android browser. idea why?

you need refresh browser few times, must've cached css. looks way expect on android 4.4.

to clear cache on chrome android:

  1. touch chrome menu > settings.

  2. touch (advanced) privacy.

  3. touch clear browsing data.

if still not work demo let me know version , browser you're using on android.

update: (for wondering) solved adding width element being centered. in order margin:auto; work on old browsers, in case added width:auto;

demo test http://jsfiddle.net/lw543yys/. <> enter image description here

        <> 

Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -