XSLT - Add CSS elements into XSLT

0 votes
185 views
added Sep 26, 2019 in XSLT by anonymous
<!--Can’t add the style above heads, need to add/wrap inside the div element itself-->
 
<div id="ads-on-postad">
  
  <style>
.dfp-mobile {
    height: 50px;
    width: 300px;
    z-index: 1;
    /*background: #f9d5e7*/
      
    ;
    margin: 0 0 10px 9px;
    text-align: center;
}
.dfp-mobile img { 
  width: 320px;
  height: auto;
}
</style>
  
 <xsl:choose>
  <xsl:when test="$DeviceType='Desktop'">
     <!--<div >
      desktop ad goes here
    </div>-->
  </xsl:when>
  
  
  <xsl:otherwise>
    <xsl:choose>
     <xsl:when test="$DeviceType='Mobile'">
  
      <div class="dfp-mobile">
        <!--ADS GOES HERE-->
        
        <xsl:call-template name="RenderDFPTag">
            <xsl:with-param name="position" select="1" />
        </xsl:call-template>
        
      </div>
        </xsl:when>
     </xsl:choose>
  </xsl:otherwise>
  
 </xsl:choose>
</div >

 

lazacode.org - Malaysia's programming knowledge sharing platform, where everyone can share their finding as reference to others.
...