inherit
Official Code Helper
65613
0
1
May 8, 2024 9:12:48 GMT -8
Chris
"'Oops' is the sound we make when we improve"
8,874
December 2005
horace
|
Post by Chris on May 24, 2013 13:07:30 GMT -8
This is in regards to the reply made by Keith Rozett in this bug report since that board is now locked to replies by anybody other than staff I thought this bug was already addressed since the center tags now use the align="center" attribute rather than the style="text-align:center;" at the time the report was filed but my experience is that text-align doesn't affect block elements in most browsers except IE, in other browsers one has to set the margin-left and margin-right to auto to get block-level elements centered. I haven't recently checked for any changed behavior specifically in Chrome but the property as written in specs should not be having any effect on block-level elements, only text and inline elements such as img would be affected which is not the same behavior as center tags.
|
|
Keith Rozett
Full Member
Not that kind of doctor.
Not even the other kind, technically.
Posts: 720
inherit
Not that kind of doctor.
186408
0
Jul 7, 2015 11:21:48 GMT -8
Keith Rozett
Not even the other kind, technically.
720
November 2012
krozett
|
Post by Keith Rozett on May 24, 2013 13:24:54 GMT -8
Whoops, I forgot that the board containing the old report was locked. Sorry about that. It's true that "text-align: center" won't center block elements, but I don't know that the <center> tag in modern browsers does that anyway. I can't be certain, since that's a tag I haven't used in years.
|
|
Keith Rozett
Full Member
Not that kind of doctor.
Not even the other kind, technically.
Posts: 720
inherit
Not that kind of doctor.
186408
0
Jul 7, 2015 11:21:48 GMT -8
Keith Rozett
Not even the other kind, technically.
720
November 2012
krozett
|
Post by Keith Rozett on May 24, 2013 13:42:35 GMT -8
Well, I stand corrected!
IE7 treats them all the same: <center> <div align="center"> <div style="text-align: center;">
All other browsers treat the top 2 as the same (centering block-level elements), but the 3rd is only text.
However, the 3rd one is what I'm still getting when I use the center bbcode tag. I'll change it so that we use div align="center", since that's already allowed by our bbcode parser. (Try it and it should work.)
|
|
Keith Rozett
Full Member
Not that kind of doctor.
Not even the other kind, technically.
Posts: 720
inherit
Not that kind of doctor.
186408
0
Jul 7, 2015 11:21:48 GMT -8
Keith Rozett
Not even the other kind, technically.
720
November 2012
krozett
|
Post by Keith Rozett on May 24, 2013 13:43:28 GMT -8
|
|
inherit
Official Code Helper
65613
0
1
May 8, 2024 9:12:48 GMT -8
Chris
"'Oops' is the sound we make when we improve"
8,874
December 2005
horace
|
Post by Chris on May 24, 2013 13:46:35 GMT -8
I'm pretty sure it does center all elements since I've seen it used in those popular in-post journaling templates to center block-level elements. Here is a quote from the HTML3.2 spec It was deprecated in HTML4.01
|
|
Keith Rozett
Full Member
Not that kind of doctor.
Not even the other kind, technically.
Posts: 720
inherit
Not that kind of doctor.
186408
0
Jul 7, 2015 11:21:48 GMT -8
Keith Rozett
Not even the other kind, technically.
720
November 2012
krozett
|
Post by Keith Rozett on May 24, 2013 13:51:09 GMT -8
On second thought, if we're not gonna be HTML5-compliant anyway, I'm going to keep them as <center> tags. Align attributes aren't any better, they're just more bytes to store. Ideally, we'd have a .center class which would apply the text-align as well as the correct margin settings for block-level children. Maybe in V5.1!
|
|
Keith Rozett
Full Member
Not that kind of doctor.
Not even the other kind, technically.
Posts: 720
inherit
Not that kind of doctor.
186408
0
Jul 7, 2015 11:21:48 GMT -8
Keith Rozett
Not even the other kind, technically.
720
November 2012
krozett
|
Post by Keith Rozett on May 24, 2013 14:00:32 GMT -8
Yet another correction! Going with <div align="center"> instead of <center>. Since we also have [left] and [right] bbcode tags, I fixed those so that they also align block-level elements. It requires me to use that align attribute (there are no <left> or <right> tags), so I'm just making them all consistent.
|
|
inherit
Official Code Helper
65613
0
1
May 8, 2024 9:12:48 GMT -8
Chris
"'Oops' is the sound we make when we improve"
8,874
December 2005
horace
|
Post by Chris on May 24, 2013 14:08:31 GMT -8
Thanks Keith Rozett, I'm sure the RPG journaling template community will be thrilled that center tags once again work as they used to.
|
|