• Hi!
    I’m trying to figure out how to center this audio player on Android devices?

    I’m using a responsive theme and it looks fine on PC
    screenshot: http://www35.zippyshare.com/v/WVM3MUtN/file.html

    but is aligned to the right on android phones
    screenshot: http://www34.zippyshare.com/v/e5A3kG1i/file.html

    the code of the page is:
    <center><audio autoplay=”autoplay” controls=”controls”><source src=”http://188.165.192.5:8137/live&#8221; type=”audio/mp3″ />Your browser does not support the audio element.</audio></center>

    How could I get it centered in phone browsers? And is it somehow possible to change the look of the player thingy? This is not as important though 🙂

    All the best to all of you and I’d appreciate if anyone could help.

    Joh123

Viewing 7 replies - 1 through 7 (of 7 total)
  • Hey there,

    Please post a link to your site. Thanks!

    Thread Starter joh123

    (@joh123)

    First of all, <center> is a deprecated HTML tag. It’s possible the Android browser you’re using just doesn’t support it.

    Try wrapping the audio player with this instead just to see if it works:

    <div style="text-align: center"><!-- audio player here --></div>

    If not, there’s one other thing we could try.

    Thread Starter joh123

    (@joh123)

    Thanks for the tip. It’s still the same on Android though 🙁

    Okay, try this.

    First, install a plugin like Simple Custom CSS to add custom CSS code without modifying your theme.

    Then, add the following code:

    audio {
    	display: block;
    	margin-left: auto;
    	margin-right: auto;
    	width: 300px;
    }
    Thread Starter joh123

    (@joh123)

    Hi, still the same. I just noticed that it’s nicely centered in landscape view but in portrait view it’s not 🙁

    I just noticed that it’s nicely centered in landscape view but in portrait view it’s not

    Just to clarify, this wasn’t like that before you added the CSS code above?

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘How to center this supersimple audio player?’ is closed to new replies.