我有一个XSLT脚本来输出一个简单的垂直菜单,但是在我的几个链接上,文本没有包装,我不明白为什么!
试过把DIV放在链接里面,还有一个
包含文本但无济于事.
以前有人有过这种问题吗?
XSLT:
<xsl:template match="/">
<xsl:variable name="items" select="$currentPage/ancestor-or-self::* [@isDoc and @level = 2]/* [@isDoc and string(umbracoNaviHide) != '1']"/>
<!-- The fun starts here -->
<div id="subnavtitle">
<xsl:value-of select="$currentPage/@nodeName" />
</div>
<xsl:if test="count($items) > 0">
<ul>
<xsl:for-each select="$items">
<li>
<xsl:if test="@id = $currentPage/@id">
<xsl:attribute name="class">current</xsl:attribute>
</xsl:if>
<xsl:if test="@id = $currentPage/../@id">
<xsl:attribute name="class">current</xsl:attribute>
</xsl:if>
<a href="{umbraco.library:NiceUrl(@id)}" >
<p style="width: 100px;">
<xsl:value-of select="translate(@nodeName,' ',' ')"/>
</p>
</a>
</li>
</xsl:for-each>
</ul>
</xsl:if>
</xsl:template>
Run Code Online (Sandbox Code Playgroud)
CSS:
#subNavigation {
padding-top: 10px;
padding-right: 10px;
padding-left: 10px; …Run Code Online (Sandbox Code Playgroud)