'center' tag in phpbb3 :<

Get help developing custom BBCodes or request one.
User avatar
3Di
I've Been Banned!
Posts: 17538
Joined: Mon Apr 04, 2005 11:09 pm
Location: I'm with Ukraine 🇺🇦
Name: Marco
Contact:

Re: 'center' tag in phpbb3 :<

Post by 3Di »

🆓 Free support for our extensions also provided here: phpBB Studio
🚀 Looking for a specific feature or alternative option? We will rock you!
Please PM me only to request paid works. Thx. Buy me a coffee -> Image
My development's activity º PhpStorm's proud user º Extensions, Scripts, MOD porting, Update/Upgrades
User avatar
warmweer
Jr. Extension Validator
Posts: 11234
Joined: Fri Jul 04, 2003 6:34 am
Location: Van Allen Bel ... gium
Contact:

Re: 'center' tag in phpbb3 :<

Post by warmweer »

I stand corrected: there is align:center but no float:center. Thx Lumpy Burgertushie and 3Di.
I really need to test those things before opening my mouth, or start to type :oops: :(
Spelling is freeware, which means you can use it for free.
On the other hand, it is not open source, which means you cannot change it or publish it in a modified form.


Time flies like an arrow, but fruit flies like a banana.
User avatar
Ariel_Schnee
Registered User
Posts: 21
Joined: Sun Jan 13, 2019 4:40 am
Location: USA In The Northern Part Of Louisiana
Name: Ariel Schnee
Contact:

Re: 'center' tag in phpbb3 :<

Post by Ariel_Schnee »

Lumpy Burgertushie wrote: 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
Hey, thanks!

This is just what I needed now!^_^

I used

Code: Select all

[center]{TEXT}[/center]
in the "BBCode usage" box and

Code: Select all

<div style="text-align: center;">{TEXT}</div>
in the "HTML replacement" box.

It worked perfectly! ... I have no idea what any of this does (I'm kinda a ditz). But it worked. Yay!^_^

Thanks once again!^_^
User avatar
ViolaF
I've Been Banned!
Posts: 1609
Joined: Tue Aug 14, 2012 11:52 pm

Re: 'center' tag in phpbb3 :<

Post by ViolaF »

hrx wrote: 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>
centering via span or div is your choice and more a matter of taste.
i prefer span
User avatar
canonknipser
Registered User
Posts: 2096
Joined: Thu Sep 08, 2011 4:16 am
Location: Germany
Name: Frank Jakobs
Contact:

Re: 'center' tag in phpbb3 :<

Post by canonknipser »

Centering via <span> sounds useless, because <span> is a inline html element, which means it is part of a line together with other content. Why and how would you center a part of a line? See also https://codeburst.io/block-level-and-in ... 8502c1f95b

You would get invalid html if you put a block level element (eg. a <div> generated by another BBCode) inside a inline element, even if you use "show as block" (display: block;) on you inline element <span>. See https://stackoverflow.com/questions/171 ... e-elements So:
ViolaF wrote: Sun Jan 13, 2019 3:09 pm more a matter of taste
yes, if you don't bother about valid html
Last edited by canonknipser on Mon Jan 14, 2019 11:39 am, edited 1 time in total.
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
Crizzo
Translations & International Support Teams Manager
Translations & International Support Teams Manager
Posts: 1653
Joined: Thu Apr 23, 2009 1:20 pm
Location: Stuttgart, Germany
Name: Christian
Contact:

Re: 'center' tag in phpbb3 :<

Post by Crizzo »

Well, when you like to center images or text, <p> is a more meaningful choice. :)
My extensions for phpBB: CDB
German phpBB Support at www.phpbb.de
User avatar
canonknipser
Registered User
Posts: 2096
Joined: Thu Sep 08, 2011 4:16 am
Location: Germany
Name: Frank Jakobs
Contact:

Re: 'center' tag in phpbb3 :<

Post by canonknipser »

<div> is a neutral container, you can put anything inside, even text or images ;)
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
Crizzo
Translations & International Support Teams Manager
Translations & International Support Teams Manager
Posts: 1653
Joined: Thu Apr 23, 2009 1:20 pm
Location: Stuttgart, Germany
Name: Christian
Contact:

Re: 'center' tag in phpbb3 :<

Post by Crizzo »

I know, but the semantic meaning is zero. Which makes it a bad choice, if you can use more fitting element instead.
My extensions for phpBB: CDB
German phpBB Support at www.phpbb.de
User avatar
canonknipser
Registered User
Posts: 2096
Joined: Thu Sep 08, 2011 4:16 am
Location: Germany
Name: Frank Jakobs
Contact:

Re: 'center' tag in phpbb3 :<

Post by canonknipser »

For bbCode, it is not a bad choice, but a perfect choice because you can put any other tag inside and keep valid html. Since you can use bbCode inside bbCode, something like this can happen:
[center]This is [center]centered[/center] text[/center]

with div, you get
<div style="text-align:center">This is <div style="text-align:center">centered</div> text</div>
which is valid html,

with p you get
<p style="text-align:center">This is <p style="text-align:center">centered</p> text</p>
which is invalid html syntax.
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
Post Reply

Return to “Custom BBCode Development and Requests”