Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • miken 21 posts 71 karma points
    May 17, 2013 @ 00:32
    miken
    0

    change css in xslt

    Hi experts,

     

    I have the code in the .css below

    .divider {
        width: 100%;
        height: 51px;
        background: url('../images/2_Slideshow_Nav_Bar.png') no-repeat;
        z-index: 100;
        clear: both;
        margin-top: -23px;
        position: absolute;
        background-position: 510px;
    }

     

    My .xslt file has the following code, but now I need to change the red text  dynamically

    < div class="divider" > < /div >

     I mean the image filename is < xsl:value-of select="navigationBarImage"/ > , and X position is < xsl:value-of select="imageXCoordinate "/ >
    .

     

    I have no idea to do this. Any input will be appreciated

  • Claushingebjerg 936 posts 2571 karma points
    May 17, 2013 @ 09:10
    Claushingebjerg
    0

    You could do something like this

    <div class="divider" >
    <xsl:attribute name="style">
    background: url('<xsl:value-of select="umbraco.library:GetMedia($currentPage/navigationBarImage, true)/umbracoFile"/>') no-repeat; background-position: < xsl:value-of select="imageXCoordinate "/ >px;
    </xsl:attribute>
    content in div goes here
    </div>

    That would put some inline styling directly on the div overriding the style from your css file.

Please Sign in or register to post replies

Write your reply to:

Draft