我发誓我已经这样做了一百次,但是对于我的生活,我无法弄清楚为什么我的: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)
无论出于何种原因,我无法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处理能否更快地进行移动开发?
这可能是一个非常简单的答案,但对于我的生活,我无法弄明白.
我想根据显示的子元素显示某些内容,但我不知道如何测试我想要的元素.我想看看是否存在start,stop和note元素
<xsl:template match="protocol[@id=$protocolNumber]">
<h4><xsl:value-of select="$sectionNumber"/>.<xsl:value-of select="@id"/> <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]" />: <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)