本地HREF =“”标签未将一个页面链接到另一个页面

时间:2018-04-26 01:36:50

标签: html css

我正在用HTML / CSS编写一个本地页面,我仍然坚持使用我的锚标签通信。我似乎无法将我现在的页面链接到保存在同一文件夹中的另一个页面。

我的任何引用标记和与这些文件关联的文件都是这种情况。

这是我的代码:

<!DOCTYPE html>
<html>
<head>
  <title>Exceptions</title>
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<body>

<div class="panel panel-default" align="center">
  <div class="panel-body"><h2>Exception Training</h2></div>
</div>

<div class="container">
  <h3>Daily Exceptions</h3>
  <p>Please choose which excpetion you are going to be trying to fix today</p>
  <p>The Exception choiices are going to be on your left in the blue drop down menu</p>
  <div class="dropdown">
    <button class="btn btn-primary dropdown-toggle" type="button" id="menu1" data-toggle="dropdown">Please Choose...
    <span class="caret"></span></button>
    <ul class="dropdown-menu" role="menu" aria-labelledby="menu1">
      <li role="presentation"><a role="menuitem" tabindex="-1" href="C:\Users\af\Desktop\JavaScript\test\Daily Exceptions\Flow_not_gross.html">Time Frame Less Than/Equal to 3 weeks</a></li>
      <li role="presentation"><a role="menuitem" tabindex="-1" href="C:\Users\af\Desktop\JavaScript\test\Daily Exceptions\Time_Frame_less_3.html">Time Frame Less Than/Equal to 3 weeks</a></li>
      <li role="presentation"><a role="menuitem" tabindex="-1" href="C:\Users\af\Desktop\JavaScript\test\Daily Exceptions\initial_flow_not_net.html">Initial Flow Not Net Need</a></li>
      <li role="presentation"><a role="menuitem" tabindex="-1" href="C:\Users\af\Desktop\JavaScript\test\Daily Exceptions\Flow_not_gross.html">Flow Not Gross Need</a></li>
      <li role="presentation"><a role="menuitem" tabindex="-1" href="C:\Users\af\Desktop\JavaScript\test\Daily Exceptions\store_inv_greater_100.html">Store Inv >= 100</a></li>
      <li role="presentation"><a role="menuitem" tabindex="1"  href="C:\Users\af\Desktop\JavaScript\test\Daily Exceptions\exceptions_net_inv_100.html">Net Inv >= 100</a></li>
      <li role="presentation"><a role="menuitem" tabindex="-1" href="C:\Users\af\Desktop\JavaScript\test\Daily Exceptions\Deal_Alloc_greater_100.html">Deal Alloc >= 100</a></li>
    </ul>
  </div>
</div>

</body>
</html>

当我引用它时,它给出了这个非常一般的错误:

  

找不到网页

非常感谢任何帮助!

1 个答案:

答案 0 :(得分:1)

您必须使用space在路径中对%20字符进行编码,并在路径

之前附加file:///
<li role="presentation"><a role="menuitem" tabindex="-1" href="file:///C:\Users\af\Desktop\JavaScript\test\Daily%20Exceptions\Time_Frame_less_3.html">Time Frame Less Than/Equal to 3 weeks</a></li>

虽然如你所说,你的文件在同一个目录中,那么你不需要使用完整路径,你可以使用相对路径

<li role="presentation"><a role="menuitem" tabindex="-1" href="Time_Frame_less_3.html">Time Frame Less Than/Equal to 3 weeks</a></li>