<hc <at> yngoor.de> writes:

> 
> The kupu enables to center pictures which results in code like this
> 
> <div align="center">
> <img class="image-left" alt="t4.jpg" src="test-lvl51/t4.jpg"><br>
> </div>
> 
> After saving I get
> 
> <div>
> <img border="0" src="test-lvl51/t4.jpg" alt=""><br>
> </div>
> 
> I think what is needed here is something like this
> 
> css:
> img{
> display:block; /*allows the element to take auto margins*/
> margin:0 auto; /*centers in compliant browsers*/
> text-align:center; /*centers in old versions of IE*/
> }
> 
> in the div statement.
> 
> Any ideas how to implement this as a div style?
> 
> Thanks
> Christian
> 


I found a solution for the problem. Not the best from a CSS point of view, but
it works. (Lenya 1.2.4)

In

.../build/lenya/webapp/lenya/resources/kupu/apache-lenya/lenya/kupusave.xsl

I added

   <xsl:template match="xhtml:div">
    <div>
        <xsl:if test="string(@align)">
          <xsl:attribute name="align">
            <xsl:value-of select="@align"/>
          </xsl:attribute>
        </xsl:if>   
      <xsl:apply-templates/>
    </div>
   </xsl:template>


and for the 'p'-tag

    <xsl:template match="xhtml:p">
     <p>
        <xsl:if test="string(@align)">
          <xsl:attribute name="align">
            <xsl:value-of select="@align"/>
          </xsl:attribute>
        </xsl:if>   
      <xsl:apply-templates/>
    </p>
   </xsl:template>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to