我想使用 PHP 在每个页面中包含一个标题,这样当我编辑标题时,我就不必在每个页面上更改它。但是我很确定如果我这样做,相对链接将根据包含 PHP 的页面来执行。使用绝对链接执行此操作有什么问题吗?对不起,如果这是一个简单的问题,只是想知道是否有与此相关的任何规则。
<header>
<div class="navbar">
<a href="/"><img style="margin:10px;" src="../images/logo.png" alt="logo"/></a>
<a href="/"><img style="position:relative;bottom:14px;" src="../images/line.png" alt="line"/> </a>
<a href="/"><img class="navbaricon" id="one" src="../images/home.png" alt="home"/></a>
<a href="JavaScript:void(0);"><img class="navbaricon" id="two" src="../images/artist.png" alt="artists"/></a>
<a href="../releases"><img class="navbaricon" id="three" src="../images/releases.png" alt="releases"/></a>
<a href="../join"><img class="navbaricon" id="four" src="../images/join.png" alt="join"/></a>
</div>
<div class="artists">
<div class="artistlinks">
<p>Brady Hartvigsen</p>
<a href="../artists/bradyhartvigsen"><img src="../images/artists/bradymain.jpg" alt="Brady Hartvigsen"/></a>
<p>Catalyst</p>
<a href="../artists/catalyst"><img src="../images/artists/catalystmain.jpg" alt="Catalyst"/></a>
<p>Emmi Moffitt</p>
<a href="../artists/emmimoffitt"><img src="../images/artists/emmimain.jpg" alt="Emmi Moffitt"/></a>
<p>Frederik Jyll</p>
<a href="../artists/frederikjyll"><img src="../images/artists/fredmain.jpg" alt="Frederik Jyll"/></a>
<p>J.R. Hansen</p>
<a href="../artists/jrhansen"><img src="../images/artists/jrmain.jpg" alt="JR Hansen"/></a>
<p>Kate Berry</p>
<a href="../artists/kateberry"><img src="../images/artists/katemain.jpg" alt="Kate Berry"/></a>
<p>Ryan Cluff</p>
<a href="../artists/ryancluff"><img src="../images/artists/ryanmain.jpg" alt="Ryan Cluff"/></a>
<p>Silter</p>
<a href="../artists/silter"><img src="../images/artists/siltermain.jpg" alt="Silter"/></a>
</div>
</div>
<script>
$("a:nth-child(4)").click(function () {
$(".artists").animate({width:'toggle'},500);
});
</script>
</header>
这就是我的标题目前的样子