Center Images

Get help developing custom BBCodes or request one.
Post Reply
gerand
Registered User
Posts: 23
Joined: Sun Jul 31, 2016 4:24 pm

Center Images

Post by gerand » Sun Jun 11, 2017 9:50 pm

Hello, I've tried a way to center my images in phpbb posts but I'm not getting it. I used [center] image [/center] and it did not work! Is there any other way?

Sean Moran
Registered User
Posts: 46
Joined: Mon Apr 06, 2009 1:49 am

Re: Center Images

Post by Sean Moran » Mon Jun 12, 2017 7:12 am

Hello Gerand. A custom BBcode seems to work, although using the old-fashioned <center> tags </center> in HTML5 is not apparently all that recommended thesedays. It is what I have always used though. I just tested it by adding a new custom BBCode to my phpBB 3.1.10 forum under development, and it still works, although it is a bit old-fashioned, as mentioned above.

If you go to the ACP -> Posting -> BBCodes, youi will be provided with three(3) textboxes.

One(1) for the BBCode example:

Code: Select all

[center]{TEXT}[/center]
Two(2) for the HTML to produce for that BBCode:

Code: Select all

<center>{TEXT}</center>
and Three(3) for the alt text to display on mouse hover etc.

Code: Select all

Center the element.
Apologies for the Sesame Street English, but that is how HTML likes it, and so the BBCode should conform to that lazy standard. It's only code, anyway. No one's going to read it. ;)

I believe that this has worked just fine for images over all of my past forums when I have bothered to add any custom BBCode, but haven't bothered to test it just now, because I trust that anything inside the <center> tags is generally centred on the page.

I hope it helps.

gerand
Registered User
Posts: 23
Joined: Sun Jul 31, 2016 4:24 pm

Re: Center Images

Post by gerand » Sat Aug 26, 2017 10:37 pm

Hello Sean, thanks for the help! But in option 2 in html I've inserted:

Code: Select all

<div align="center">{TEXT}</div>
See: viewtopic.php?f=46&t=579376#center

This worked for me! :)

Post Reply

Return to “Custom BBCode Development and Requests”

Who is online

Users browsing this forum: No registered users and 6 guests