Project

General

Profile

Actions

Bug #14760

closed

When I upgraded to 3.8.0 and looked at my site with Firefox, most of my images were not aligned properly anymore.

Added by Torsten Schrade over 19 years ago. Updated over 18 years ago.

Status:
Closed
Priority:
Should have
Category:
Frontend
Target version:
-
Start date:
2005-05-27
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
3.8.0
PHP Version:
4
Tags:
Complexity:
Is Regression:
Sprint Focus:

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

workaround.css (1.37 KB) workaround.css Administrator Admin, 2005-05-27 19:07
class.tslib_content_diff.txt (3.77 KB) class.tslib_content_diff.txt Administrator Admin, 2005-06-05 17:14
bug_1115.diff (977 Bytes) bug_1115.diff Administrator Admin, 2005-09-30 16:43
bug_1115_solution2.diff (2.69 KB) bug_1115_solution2.diff Administrator Admin, 2005-09-30 16:43
image_align_fix.diff (1.53 KB) image_align_fix.diff Administrator Admin, 2005-11-08 22:10

Related issues 3 (0 open3 closed)

Has duplicate TYPO3 Core - Bug #14761: Image alignment not working with FirefoxClosed2005-05-27

Actions
Has duplicate TYPO3 Core - Bug #14794: Fehlerhafte DarstellungClosedKarsten Dambekalns2005-06-06

Actions
Has duplicate TYPO3 Core - Bug #15345: IMGTEXT table align problem with Internet ExplorerClosedSebastian Kurfuerst2006-01-03

Actions
Actions

Also available in: Atom PDF