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:
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:
touch chrome menu > settings.
touch (advanced) privacy.
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/. <>
<>
Comments
Post a Comment