I'm using the itemstyle.xsl file to format a CQWP query on a page. Everything is working except that I want to fix the height and width of an image. I'm displaying the image with :

<xsl:value-of select="@PublishingPageImage" disable-output-escaping="yes" />

The output of this line is :

<img style="BORDER: 0px solid; " src="/SiteCollectionImages/theImage.gif" alt="">

Is there a way to set the width and height of the image on ? I'm not a big xslt expert... I couldn't find any example.

Thank you, Chris

1 Answer 1


In your XSLT when you render the Image you can add attributes to that element.


<img src="{$ImageUrl}" title="blah" alt="blah">
    <xsl:attribute name="height">90px</xsl:attribute>
    <xsl:attribute name="width">150px</xsl:attribute>

Hope this helps :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.