'center' tag in phpbb3 :<

Get help developing custom BBCodes or request one.
User avatar
3Di
Registered User
Posts: 13294
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milan (IT) Frankfurt (DE)
Name: Marco
Contact:

Re: 'center' tag in phpbb3 :<

Post by 3Di » Sat Nov 17, 2018 1:09 am

Please PM me only to request paid works. Thx.
Want to compensate me for my interest? Donate
My development's activity º PhpStorm's proud user
The new Dice Roller extension for phpBB 3.2 :game_die:
Extensions, Scripts, MOD porting, Update/Upgrades

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

Re: 'center' tag in phpbb3 :<

Post by warmweer » Sat Nov 17, 2018 8:35 am

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: :(
A bug is a feature that hasn't made it to the manual (yet)

User avatar
Ariel_Schnee
Registered User
Posts: 10
Joined: Sun Jan 13, 2019 4:40 am
Location: In Northern Louisiana
Name: Ariel Schnee
Contact:

Re: 'center' tag in phpbb3 :<

Post by Ariel_Schnee » Sun Jan 13, 2019 5:36 am

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!^_^
Animelist - Signature - Ariel Schnee - Homepage - My Fics - Full Version Avatar

If you are a believer of Jesus Christ, and are 100% proud of it, put this in your sig!!

- Ariel Schnee, twin sister of Weiss Schnee. And Loyal Servant of The Royal Pony Sisters, Princess Celestia and Princess Luna... Forever Equestria!

User avatar
ViolaF
Registered User
Posts: 1427
Joined: Tue Aug 14, 2012 11:52 pm

Re: 'center' tag in phpbb3 :<

Post by ViolaF » Sun Jan 13, 2019 3:09 pm

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: 1805
Joined: Thu Sep 08, 2011 4:16 am
Location: Germany
Name: Frank Jakobs
Contact:

Re: 'center' tag in phpbb3 :<

Post by canonknipser » Sun Jan 13, 2019 4:12 pm

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: 835
Joined: Thu Apr 23, 2009 1:20 pm
Location: Germany
Name: Christian
Contact:

Re: 'center' tag in phpbb3 :<

Post by Crizzo » Sun Jan 13, 2019 4:19 pm

Well, when you like to center images or text, <p> is a more meaningful choice. :)
My extensions for phpBB: crizzo.de
German phpBB Support at www.phpbb.de

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

Re: 'center' tag in phpbb3 :<

Post by canonknipser » Sun Jan 13, 2019 5:11 pm

<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: 835
Joined: Thu Apr 23, 2009 1:20 pm
Location: Germany
Name: Christian
Contact:

Re: 'center' tag in phpbb3 :<

Post by Crizzo » Sun Jan 13, 2019 5:13 pm

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: crizzo.de
German phpBB Support at www.phpbb.de

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

Re: 'center' tag in phpbb3 :<

Post by canonknipser » Sun Jan 13, 2019 8:08 pm

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”

Who is online

Users browsing this forum: No registered users and 5 guests