MC-XOBAHCK,
Твой скрипт не хочет выполнять задачу
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="https://www.w3.org/1999/xhtml">
<head>
<title>transform</title>
</head>
<body>
<style type="text/css">
body { font: 14px normal Times, serif; }
div { border: 1px solid #ccc; padding: 5px; margin: 5px; }
a { text-decoration: none; color: #3c3vff; }
.xyz1 { color: #009900; }
.xyz2 { color: #11b311; }
.xyz3 { color: #28cc28; }
</style>
<body>
<script>
let page = window.location.pathname;
let links = document.querySelectorAll('a');
for (let i = 0; i < links.length; i++) {
if (links[i].pathname == page) {
links[i].outerHTML = '<span class="xyz3">' + links[i].textContent + '</span>';
}
}
</script>
<div>
<a href="/html.html">HTML</a>
<a href="/css.html">CSS</a>
<a href="/js.html">JS</a>
</div>
<div>
<a href="/css/css3.html">CSS3</a><br/>
<div>
<a href="/css/css3/transform.html">transform</a><br/>
<a href="/css/css3/transform-origin.html">transform-origin</a><br/>
<a href="/css/css3/transform-style.html">transform-style</a><br/>
</div>
</div>
</body>
</html>
Ой, двоеточие пропустила после padding