#1098 Wrong CSS property to align img in XHTML 1.1

output: HTML
open
XSL (1066)
5
2010-02-03
2010-01-27
Anonymous
No

The XHTML 1.1 style sheets use the wrong CSS property to left- or right-align an image. Currently this is generated for a left-aligned image:

<img style="text-align:left"/>

The CSS property which must be used though is float:

<img style="float:left"/>

To fix this lines 580 to 589 in xhtml-1_1/graphics.xsl have to be updated to:

<xsl:if test="@align">
<xsl:choose>
<xsl:when test="@align = 'left' or @align = 'right'">
<xsl:attribute name="style"><xsl:text>float: </xsl:text>
<xsl:value-of select="@align"/>
</xsl:attribute>
</xsl:when>
<xsl:otherwise>
<xsl:attribute name="style"><xsl:text>text-align: </xsl:text>
<xsl:choose>
<xsl:when test="@align = 'center'">middle</xsl:when>
<xsl:otherwise>
<xsl:value-of select="@align"/>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
</xsl:otherwise>
</xsl:choose>
</xsl:if>

Discussion

  • Comment has been marked as spam. 
    Undo

    You can see all pending comments posted by this user  here

    Anonymous - 2010-01-28
    • assigned_to: nobody --> abdelazer
     
  • Comment has been marked as spam. 
    Undo

    You can see all pending comments posted by this user  here

    Anonymous - 2010-02-03

    I think I had assigned the bug to the wrong person. :-)

     
  • Comment has been marked as spam. 
    Undo

    You can see all pending comments posted by this user  here

    Anonymous - 2010-02-03
    • assigned_to: abdelazer --> bobstayton
     
  • Robert Stayton

    Robert Stayton - 2010-02-03
    • assigned_to: bobstayton --> abdelazer
     
  • Robert Stayton

    Robert Stayton - 2010-02-03

    Actually, you had it right the first time. Keith Fahlgren (abdelazer) knows the most about the XHTML 1.1 and ePub stylesheets at this point, so I'm reassigning this bug to him.

     

Log in to post a comment.