Bug #14760
closedWhen I upgraded to 3.8.0 and looked at my site with Firefox, most of my images were not aligned properly anymore.
0%
Description
In the new 3.8.0 there is a bug regarding the rendering of the
"classical", table-based IMGTEXT-Objects in line 1085ff. of class.tslib_content.php. In Gecko/Opera browsers centered images and images positioned to the right all stay on the left side. With IE, however, the alignment is allright.
This is due to the fact that in 3.8 the concept of using the align-attribute for the enclosing divs has been abandoned, as
this attribute is deprecated for XHTML-strict doctypes. Now it's done with
<div style="text-align:the_position;"><table><img></table></div>
But this works only for IE, as aligning and especially centering tables within a div should be done by setting proper margins(auto) or floating the table. Firefox et.all simply ignore the text-align rule. This issue is explained here in quite a good way:
http://theodorakis.net/tablecentertest.html
Just position images and look at your page with Firefox.
A first workaround to circumvent the problem can be achieved by inserting additional divs and using a CSS attribute-selection that only Gecko/Opera browsers unserstand. In the long run this is not desirable, as it creates quite some tag-soup. Please refer to the attached workaround.css for this.
In conclusion, it would be much better if the core could output some position-specific class in addition to the style-attribute like
<div style="text-align: center" class="imageorient-0"><table>...</div>
However, using the text-align property might sometimes be problematic as it could lead to unwanted alignments within the imgtext-table itself.
As the align-attribute is not deprecated for all the other doctypes except XHTML Strict, another maybe more economical approach could be to combine the alignment method with the chosen doctype in config.doctype.
Like with the border-attribute for images, the text-align method could only come into effect (maybe with the attached styles as inline or temporary styles) when the doctype is set to XHTML strict.
(issue imported from #M1115)
Files