css: highlight current item (#id) v_0
authorFrantišek Kučera <franta-hg@frantovo.cz>
Sat, 05 Oct 2019 22:22:22 +0200
branchv_0
changeset 53 f62393f88eab
parent 52 98a4b319bfa3
child 54 9f5de01bfd30
css: highlight current item (#id)
templates/ssm.xhtml.xsl
templates/style.css
--- a/templates/ssm.xhtml.xsl	Sat Oct 05 21:44:48 2019 +0200
+++ b/templates/ssm.xhtml.xsl	Sat Oct 05 22:22:22 2019 +0200
@@ -96,14 +96,16 @@
 	
 	
 	<xsl:template match="m:chapter">
-		<h2>
-			<xsl:value-of select="m:name"/>
-			<xsl:text> </xsl:text>
-			<a href="#{m:id}" id="{m:id}" class="anchor">#</a>
-		</h2>
-		<ul>
-			<xsl:apply-templates select="m:item"/>
-		</ul>
+		<div id="{m:id}" class="chapter">
+			<h2>
+				<xsl:value-of select="m:name"/>
+				<xsl:text> </xsl:text>
+				<a href="#{m:id}" class="anchor">#</a>
+			</h2>
+			<ul>
+				<xsl:apply-templates select="m:item"/>
+			</ul>
+		</div>
 	</xsl:template>
 	
 	
--- a/templates/style.css	Sat Oct 05 21:44:48 2019 +0200
+++ b/templates/style.css	Sat Oct 05 22:22:22 2019 +0200
@@ -31,6 +31,10 @@
 	text-decoration: none;
 }
 
+li:target, div.chapter:target {
+   background: #eee;
+}
+
 p.footer {
 	font-size: 80%;
 }