Page 1 of 2

'center' tag in phpbb3 :<

Posted: Thu Sep 13, 2018 8:55 pm
by Rika
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?

Re: 'center' tag in phpbb3 :<

Posted: Fri Sep 14, 2018 12:46 am
by AbaddonOrmuz
<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]

Re: 'center' tag in phpbb3 :<

Posted: Tue Sep 18, 2018 6:51 pm
by hrx
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>

Re: 'center' tag in phpbb3 :<

Posted: Tue Sep 18, 2018 10:25 pm
by Lumpy Burgertushie
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

Re: 'center' tag in phpbb3 :<

Posted: Wed Sep 19, 2018 6:59 am
by hrx
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>

Re: 'center' tag in phpbb3 :<

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

Code: Select all

[Center]{TEXT}[/Center]

Code: Select all

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

Re: 'center' tag in phpbb3 :<

Posted: Mon Sep 24, 2018 10:22 am
by hrx
Thanks for the information. ;)

Re: 'center' tag in phpbb3 :<

Posted: Mon Sep 24, 2018 4:28 pm
by canonknipser
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

Re: 'center' tag in phpbb3 :<

Posted: Mon Sep 24, 2018 5:09 pm
by hrx
So what is the new syntax compatible with HTML5?

Re: 'center' tag in phpbb3 :<

Posted: Mon Sep 24, 2018 5:23 pm
by HiFiKabin
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

Re: 'center' tag in phpbb3 :<

Posted: Tue Sep 25, 2018 4:08 am
by Lumpy Burgertushie
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

Re: 'center' tag in phpbb3 :<

Posted: Tue Sep 25, 2018 8:13 am
by HiFiKabin
I'd forget my head if it wasn't screwed on :roll:

Thanks Robert

Re: 'center' tag in phpbb3 :<

Posted: Tue Sep 25, 2018 6:00 pm
by canonknipser
hrx wrote:
Mon Sep 24, 2018 5:09 pm
So what is the new syntax compatible with HTML5?
Follow the link:

Re: 'center' tag in phpbb3 :<

Posted: Fri Nov 16, 2018 7:35 pm
by warmweer
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

Re: 'center' tag in phpbb3 :<

Posted: Sat Nov 17, 2018 12:54 am
by Lumpy Burgertushie
I haven't checked that but I have never heard of a center attribute for float. just left, right and none.


robert