'center' tag in phpbb3 :<

Get help developing custom BBCodes or request one.
Rika
Registered User
Posts: 1
Joined: Thu Sep 13, 2018 8:46 pm

'center' tag in phpbb3 :<

Post by Rika » Thu Sep 13, 2018 8:55 pm

Why does not the 'center' tag work?

Did not work:

Code: Select all

[center] {TEXT} [/center]

[centre] {TEXT} [/centre]

<center>{TEXT}</center>

<div align="center">{TEXT}</div> 
How to make the 'center' tag work?

User avatar
AbaddonOrmuz
Registered User
Posts: 428
Joined: Wed Dec 25, 2013 9:06 pm
Location: /dev/null
Name: Alfredo Ramos
Contact:

Re: 'center' tag in phpbb3 :<

Post by AbaddonOrmuz » Fri Sep 14, 2018 12:46 am

<center> is no longer supported in HTML5.

BBCode template:

Code: Select all

[center]{TEXT}[/center]
HTML replacement:

Code: Select all

<div style="text-align:center">{TEXT}</div>
I'm using the following, it might help you:

BBCode template:

Code: Select all

[align={CHOICE=left,right,center,justify;defaultValue=left}]{TEXT}[/align]
HTML replacement:

Code: Select all

<div style="text-align:{CHOICE}">{TEXT}</div>
Example:

Code: Select all

[align=center]Centered text[/align]
A proudly user of Arch Linux :: /r/sddm_themes

hrx
Registered User
Posts: 196
Joined: Wed Nov 18, 2015 11:21 am

Re: 'center' tag in phpbb3 :<

Post by hrx » Tue Sep 18, 2018 6:51 pm

This code for centring is correct? The code works correctly in my forum.

Code: Select all

[centre]{TEXT}[/centre]

<span style="display: block; text-align: center;">{TEXT}</span>

User avatar
Lumpy Burgertushie
Registered User
Posts: 65307
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: 'center' tag in phpbb3 :<

Post by Lumpy Burgertushie » Tue Sep 18, 2018 10:25 pm

point is that phpbb does not come with a center bbcode at all. you do have to create one yourself. the posts above show you how.

robert
I am available for custom work on a donation basis. Please send me a PM with your needs.

Premium phpBB 3.2 Styles by PlanetStyles.net

OK, so what's the speed of dark?

hrx
Registered User
Posts: 196
Joined: Wed Nov 18, 2015 11:21 am

Re: 'center' tag in phpbb3 :<

Post by hrx » Wed Sep 19, 2018 6:59 am

I know it. My code has a "span style", this is correct?

Code: Select all

<span style="display: block; text-align: center;">{TEXT}</span>
Whether simply better to use this code?

Code: Select all

<div style="text-align:{CHOICE}">{TEXT}</div>

User avatar
HiFiKabin
Community Team Member
Community Team Member
Posts: 3329
Joined: Wed May 14, 2014 9:10 am
Location: Swearing at the PC, UK
Name: James
Contact:

Re: 'center' tag in phpbb3 :<

Post by HiFiKabin » Wed Sep 19, 2018 9:43 am

This is what I use

Code: Select all

[Center]{TEXT}[/Center]

Code: Select all

<div align="center">{TEXT}</div>

hrx
Registered User
Posts: 196
Joined: Wed Nov 18, 2015 11:21 am

Re: 'center' tag in phpbb3 :<

Post by hrx » Mon Sep 24, 2018 10:22 am

Thanks for the information. ;)

User avatar
canonknipser
Registered User
Posts: 1704
Joined: Thu Sep 08, 2011 4:16 am
Location: Germany
Name: Frank Jakobs
Contact:

Re: 'center' tag in phpbb3 :<

Post by canonknipser » Mon Sep 24, 2018 4:28 pm

HiFiKabin wrote:
Wed Sep 19, 2018 9:43 am
This is what I use

Code: Select all

<div align="center">{TEXT}</div>
You know that's deprecated syntax and not compatible with HTML5? See: https://www.w3schools.com/tags/att_div_align.asp
Greetings, Frank
phpbb.de support team member
English is not my native language - no support via PM or mail
New arrival - Extensions and scripts for phpBB

hrx
Registered User
Posts: 196
Joined: Wed Nov 18, 2015 11:21 am

Re: 'center' tag in phpbb3 :<

Post by hrx » Mon Sep 24, 2018 5:09 pm

So what is the new syntax compatible with HTML5?

User avatar
HiFiKabin
Community Team Member
Community Team Member
Posts: 3329
Joined: Wed May 14, 2014 9:10 am
Location: Swearing at the PC, UK
Name: James
Contact:

Re: 'center' tag in phpbb3 :<

Post by HiFiKabin » Mon Sep 24, 2018 5:23 pm

No I didn't Frank (well, I did but I forgot :oops: ) thanks for reminding me.

Code: Select all

<div style="text-align: center">{TEXT}</div>
Works and is AFAIK HTML5 compliant

User avatar
Lumpy Burgertushie
Registered User
Posts: 65307
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: 'center' tag in phpbb3 :<

Post by Lumpy Burgertushie » Tue Sep 25, 2018 4:08 am

HiFiKabin wrote:
Mon Sep 24, 2018 5:23 pm
No I didn't Frank (well, I did but I forgot :oops: ) thanks for reminding me.

Code: Select all

<div style="text-align: center">{TEXT}</div>
Works and is AFAIK HTML5 compliant
actually, it should be :

Code: Select all

<div style="text-align: center;">{TEXT}</div>
you missed the semi colon

robert
I am available for custom work on a donation basis. Please send me a PM with your needs.

Premium phpBB 3.2 Styles by PlanetStyles.net

OK, so what's the speed of dark?

User avatar
HiFiKabin
Community Team Member
Community Team Member
Posts: 3329
Joined: Wed May 14, 2014 9:10 am
Location: Swearing at the PC, UK
Name: James
Contact:

Re: 'center' tag in phpbb3 :<

Post by HiFiKabin » Tue Sep 25, 2018 8:13 am

I'd forget my head if it wasn't screwed on :roll:

Thanks Robert

User avatar
canonknipser
Registered User
Posts: 1704
Joined: Thu Sep 08, 2011 4:16 am
Location: Germany
Name: Frank Jakobs
Contact:

Re: 'center' tag in phpbb3 :<

Post by canonknipser » Tue Sep 25, 2018 6:00 pm

hrx wrote:
Mon Sep 24, 2018 5:09 pm
So what is the new syntax compatible with HTML5?
Follow the link:
Greetings, Frank
phpbb.de support team member
English is not my native language - no support via PM or mail
New arrival - Extensions and scripts for phpBB

User avatar
warmweer
Registered User
Posts: 1437
Joined: Fri Jul 04, 2003 6:34 am
Location: Van Allen Belt ... well actually Belgium

Re: 'center' tag in phpbb3 :<

Post by warmweer » Fri Nov 16, 2018 7:35 pm

Not sure why you're using align instead of float
IIRC you can't use left right and center in 1 line without getting linebreaks.
With float that is possible (I think)
something like:

BBcode Usage : [float=center]{TEXT}[/float]

HTML Replacement : <div style="float:center; padding:0 12px;">{TEXT}</div>

*change padding and px to what fits your style best.


edit at 22:53
: just saw that approximately the same was earlier this week : viewtopic.php?f=438&t=2490751#p15121906
A bug is a feature that hasn't made it to the manual (yet)

User avatar
Lumpy Burgertushie
Registered User
Posts: 65307
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: 'center' tag in phpbb3 :<

Post by Lumpy Burgertushie » Sat Nov 17, 2018 12:54 am

I haven't checked that but I have never heard of a center attribute for float. just left, right and none.


robert
I am available for custom work on a donation basis. Please send me a PM with your needs.

Premium phpBB 3.2 Styles by PlanetStyles.net

OK, so what's the speed of dark?

Post Reply

Return to “Custom BBCode Development and Requests”

Who is online

Users browsing this forum: No registered users and 4 guests