小编cfr*_*ree的帖子

::之前的伪元素,负z-index不显示在父元素后面

我发誓我已经这样做了一百次,但是对于我的生活,我无法弄清楚为什么我的:before伪元素的背景显示在文本后面但不在锚点的背景后面.思考?

.button {
    background: tomato;
    padding: 10px 30px;
    margin: 20px 0;
    display: inline-block;
}

.button:hover {
    margin: 18px 0 22px 2px;
    position: relative;
    z-index: 2;
}

.button:hover:after {
    position: absolute;
    background: red;
    top:-2px;
    left: -2px;
    content: "";
    z-index: -10;
    width: 100%;
    height: 100%;
}
Run Code Online (Sandbox Code Playgroud)
<a class="button" href="#">Meow</a>
Run Code Online (Sandbox Code Playgroud)

此处示例:http://jsfiddle.net/cfree/hnKLr/

html css

6
推荐指数
1
解决办法
6192
查看次数

Safari中没有XSLTProcessor()支持?

无论出于何种原因,我无法XSLTProcessor()一直工作.

这是我的JS:

... xsltProcessor = new XSLTProcessor();
xsltProcessor.importStylesheet(xmlRequest.responseXML);
// Pass variables
xsltProcessor.setParameter(null, "sectionNumber", section);
xsltProcessor.setParameter(null, "entryNumber", elementNo);

// Transform XML using XSL
var resultDocument = xsltProcessor.transformToFragment(phonebookDump,document);
// Append to document
document.getElementById('three').appendChild(resultDocument);
Run Code Online (Sandbox Code Playgroud)

适用于:OSX上的Firefox,OSX上的iPhone模拟器,OSX上的Safari

完全不起作用:iPhone上的Mobile Safari,Windows上的Safari

我错过了什么吗?有解决方法XSLTProcessor()吗?无论如何,服务器端XSLT处理能否更快地进行移动开发?

iphone xslt safari mobile-safari

3
推荐指数
1
解决办法
1814
查看次数

测试XSLT中是否存在XML元素

这可能是一个非常简单的答案,但对于我的生活,我无法弄明白.

我想根据显示的子元素显示某些内容,但我不知道如何测试我想要的元素.我想看看是否存在start,stop和note元素

<xsl:template match="protocol[@id=$protocolNumber]">
<h4><xsl:value-of select="$sectionNumber"/>.<xsl:value-of select="@id"/>&nbsp;<xsl:value-of select="@title"/></h4>
<p>
     <xsl:for-each select="child::*"> 
        <xsl:choose>
            <xsl:when test="start">
                <span id="start"><xsl:value-of select="start[@level]" /></span>
            </xsl:when>
            <xsl:when test="stop">
                <span id="stop"><xsl:value-of select="stop[@level]" /></span>
            </xsl:when>
            <xsl:when test="note">
                <span id="note"><xsl:value-of select="note[@title]" />:&nbsp;<xsl:value-of select="note/text()" /></span>
            </xsl:when>
            <xsl:otherwise>
                <xsl:value-of select="text()"/><br/>
            </xsl:otherwise>
        </xsl:choose>
    </xsl:for-each>
</p>
Run Code Online (Sandbox Code Playgroud)

<protocol id="2" title="Post-Conversion Of VF / VT">
            <note title="criteria">Post-conversion treatment of VF or VT should only be started if the patient has regained a pulse of adequate rate, and has a supraventricular rhythm.  If not, refer to other …
Run Code Online (Sandbox Code Playgroud)

xml xslt

1
推荐指数
1
解决办法
5954
查看次数

标签 统计

xslt ×2

css ×1

html ×1

iphone ×1

mobile-safari ×1

safari ×1

xml ×1