• Resolved pcwzrd13

    (@pcwzrd13)


    I’m having some trouble trying to center a custom HTML block (an embedded iframe to be more specific). It worked fine on my previous theme but on Blocksy it just aligns left on the live page. Oddly it shows it centered in the preview though.

    The code I’m using looks like this:

    <p align="center"> CUSTOM HTML HERE </p>
    
    

    Any ideas on how I can fix this or is it a bug with the theme?

Viewing 8 replies - 1 through 8 (of 8 total)
  • Theme Author Creative Themes

    (@creativethemeshq)

    Hi @pcwzrd13,

    Please share your website URL so I could take a closer look.

    Thread Starter pcwzrd13

    (@pcwzrd13)

    Sure, here’s one of the pages I’m having the issue with. The leaderboard below the banner image should be centered.

    Theme Author Creative Themes

    (@creativethemeshq)

    I’m not sure what theme you used before, but this align="center" attribute won’t center the iframe inside the p tag in any theme I’ve tested.

    Are you sure you didn’t used a different method to center the iframe?

    P.S. What theme did you used before?

    Theme Author Creative Themes

    (@creativethemeshq)

    By the way, did you tried to add a margin: 0 auto style to your iframe?

    The final code should look something like this:

    <p><iframe style="margin: 0 auto;" loading="lazy" frameborder="0" width="500" height="900" src="https://shumania.ddns.net/AFO_HIGHSCORE.html"></iframe></p>

    Hope this helps.

    Thread Starter pcwzrd13

    (@pcwzrd13)

    It definitely worked on the Sinatra theme I was using previously. As soon as I switched themes, it went from centered to left.

    It also shows up centered in the editor as you can see in the screenshot below but just doesn’t on the published website.

    Theme Author Creative Themes

    (@creativethemeshq)

    I just tested the Sinatra theme and it works the same way like with Blocksy, please see this video – https://d.pr/v/tYbYbV

    How did you exactly emebded the iframe in Sinatra theme on your end? Could you please record a video?

    Thread Starter pcwzrd13

    (@pcwzrd13)

    Just tried the code you posted and that fixed it! Thanks!

    Theme Author Creative Themes

    (@creativethemeshq)

    Hey @pcwzrd13, awesome, glad it works 🙂

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘Can’t Center Custom HTML’ is closed to new replies.