我正在尝试使用Thymeleaf创建一个网页。所有设置正确我设法进入主页然后尝试使用指向另一个页面的链接但是我收到以下错误:
“异常解析文档:template =”lor1“,第70行 - 第68列” 和“lineNumber:70; columnNumber:68;元素类型”a“必须后跟属性规范,”>“或”/>“。
然而,主页正在使用并且工作正常。
这是代码:
<title>League Of Ronnie</title>
<link href="../../../resources/css/style.css"
th:href="@{/resources/css/style.css}" rel="stylesheet" />
</head>
<body>
<div id="background">
<div id="header">
<div>
<div>
<a th:href="@{/}" class="logo"><img th:src="@{/resources/images/logo.png}" alt="" /></a>
<ul>
<li>
<a href="index.html" id="menu1">home</a>
</li>
<li>
<a href="media.html" id="menu2">the world</a>
</li>
<li>
<a href="games.html" id="menu3">the game</a>
</li>
<li>
<a href="about.html" id="menu4">about</a>
</li>
<li class="selected">
<a href="blog.html" id="menu5">the ronnie</a>
</li>
</ul>
</div>
</div>
</div>
<div id="body">
<div>
<div>
<div class="blog">
<div class="content">
<ul>
<li>
<div class="header">
<b id="a1">Warrior</b><span><a href="#" id="a2">STRENGTH</a><a href="#" id="a3">SWORD</a><a href="#" id="a4">PLATE</a></span>
</div>
<div class="article">
<a href="#" class="figure"><img id="im1" src="images/img1.jpg" alt=""/></a>
<p>
You can replace all this text with your own text. You can remove any link to our website from this website template, you're free to use this website template without linking back to us. If you're having problems editing this website template, then don't hesitate to ask for help on the <a href="http://www.freewebsitetemplates.com/forums/">Forum</a>.<br/>
<a href="blog.html" class="more">read more</a>
</p>
</div>
</li>
</ul>
</div>
<div class="sidebar">
<div>
<span><a href="'javascript:change1();'" class="selected" id="l1">Classes</a></span> <span><a href="'javascript:change2();'" id="l2">Servants</a></span>
</div>
<ul>
<li>
<a href="'javascript:Warrior();'" id="b1">Warrior</a>
<span><a href="2.html
" id="b2">STRENGTH</a><a href="#" id="b3">SWORD</a><a href="#" id="b4">PLATE</a></span>
</li>
<li>
<a href="'javascript:Paladin();'" id="b5">Paladin</a>
<span><a href="2.html" id="b6">JUSTICE</a><a href="2.html"id="b7">HAMMER</a><a href="2.html" id="b8">PLATE</a></span>
</li>
<li>
<a href="'javascript:Assassin();'" id="b9">Assassin</a>
<span><a href="2.html"id="b10">AGILITY</a><a href="#" id="b11">DAGGER</a><a href="#" id="b12">LEATHER</a></span>
</li>
<li>
<a href="'javascript:Ranger();'" id="b13">Ranger</a>
<span><a href="2.html" id="b14">FOCUS</a><a href="#" id="b15">BOW</a><a href="#" id="b16">LEATHER</a></span>
</li>
<li>
<a href="'javascript:Mage();'" id="b17">Mage</a>
<span><a href="#" id="b18">SPELLPOWER</a><a href="#" id="b19">STAFF</a><a href="#" id="b20">CLOTH</a></span>
</li>
<li>
<a href="'javascript:Priest();'" id="b21">Priest</a>
<span><a href="#" id="b22">SPIRIT</a><a href="#" id="b23">RELIC</a><a href="#" id="b24">CLOTH</a></span>
</li>
<li>
<a href="'javascript:Warlock();'" id="b25">Warlock</a>
<span><a href="#" id="b26">CURSE</a><a href="#" id="b27">SCEPTER</a><a href="#" id="b28">CLOTH</a></span>
</li>
<li>
<a href="'javascript:Warlord();'" id="b29">Warlord</a>
<span><a href="#" id="b30">FURY</a><a href="#" id="b31">AXE</a><a href="#" id="b32">PLATE</a></span>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
<div id="footer">
<div>
<ul>
<li id="facebook">
<a href="http://freewebsitetemplates.com/go/facebook/">facebook</a>
</li>
<li id="twitter">
<a href="http://freewebsitetemplates.com/go/twitter/">twitter</a>
</li>
<li id="googleplus">
<a href="http://freewebsitetemplates.com/go/googleplus/">googleplus</a>
</li>
</ul>
<p>
@ copyright 2012. all rights reserved.
</p>
</div>
</div>
</div>
<script type="text/javascript" th:src="@{/resources/lor.js}"></script>
</body>
</html>
提前致谢!
答案 0 :(得分:2)
您的错误来自href属性(2.html)和id属性(b7)之间的空格。 它应该是:
<span><a href="2.html" id="b6">JUSTICE</a><a href="2.html" id="b7">HAMMER</a><a href="2.html" id="b8">PLATE</a></span>