Html 中的样式表<;链接>;标签不会在Firefox或IE中呈现
我有一个HTML文档,在链接标记中引用了一个样式表。字符集是UTF-8,在HTML和CSS文件中定义。在Chrome和MicrosoftEdge中,CSS按其应有的方式呈现,但在Firefox和IE中,它不会加载CSS。在开发工具的控制台中没有任何错误,在我使用的IDE中也没有编译错误 我可以使用URL栏中的绝对文件路径直接转到CSS文件,它将显示文件的内容,并将HTML呈现得很好。当我将CSS包含在HTML文件本身的样式标记中时,它将呈现。但是,我想为组织链接标记它 尽管很多人都有这个问题,但我在任何地方都找不到解决方案。我想知道是否有一个已知的解决方案可以帮助我 以下是HTML:Html 中的样式表<;链接>;标签不会在Firefox或IE中呈现,html,css,Html,Css,我有一个HTML文档,在链接标记中引用了一个样式表。字符集是UTF-8,在HTML和CSS文件中定义。在Chrome和MicrosoftEdge中,CSS按其应有的方式呈现,但在Firefox和IE中,它不会加载CSS。在开发工具的控制台中没有任何错误,在我使用的IDE中也没有编译错误 我可以使用URL栏中的绝对文件路径直接转到CSS文件,它将显示文件的内容,并将HTML呈现得很好。当我将CSS包含在HTML文件本身的样式标记中时,它将呈现。但是,我想为组织链接标记它 尽管很多人都有这个问题,但
<!DOCTYPE html>
<html>
<head>
<title>#</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="\css\core-test.css" media="screen">
</head>
<body>
<div class="container">
<nav class="navbar">
<a>#</a>
</nav>
<div class="table-box">
<div class="table-body">
<table id="main-table" class="table">
<thead>
<tr>
<th>TIME</th>
<th>TICKER</th>
<th>CALL/PUT</th>
<th>EXPIRY</th>
<th>STRIKE</th>
<th>SPOT</th>
<th>PRICE</th>
<th>SIZE</th>
<th>TOTAL</th>
<th>OI</th>
<th>IV</th>
<th><button id="filterbtn" class="filterbtn fa fa-filter"></button></th>
</tr>
</thead>
<tbody>
<tr>
<td>00:12:34</td>
<td class="btc-color">BTC</td>
<td class="put-color">PUT</td>
<td>4/28</td>
<td>$7800</td>
<td>$7219</td>
<td>₿0.031</td>
<td>20</td>
<td class="put-color">₿62</td>
<td>1120</td>
<td>60.9%</td>
<td><button class="chartbtn fa fa-line-chart"></button></td>
</tr>
<tr>
<td>00:12:34</td>
<td class="btc-color">BTC</td>
<td class="put-color">PUT</td>
<td>4/28</td>
<td>$7800</td>
<td>$7219</td>
<td>₿0.031</td>
<td>20</td>
<td class="put-color">₿62</td>
<td>1120</td>
<td>60.9%</td>
<td><button class="chartbtn fa fa-line-chart"></button></td>
</tr>
</tbody>
</table>
<div id="option-modal" class="option-modal">
<div id="option-modal-box" class="option-modal-box">
<span id="closebtn" class="closebtn">×</span>
<div id="option-modal-header" class="option-modal-header">
<a id="option-modal-header-title" class="btc-color option-modal-header-title">BITCOIN</a>
</div>
<div id="option-modal-body" class="option-modal-body">
<div id="chart-box" class="chart-box">
<div class="box-header">
<a class="box-title">Chart</a>
</div>
<div style="background-color: gray;" class="box-body">
<a>chart-box</a>
</div>
</div>
<div id="orderbook-box" class="orderbook-box">
<div class="box-header">
<a class="box-title">Orderbook</a>
</div>
<div class="box-body">
<div class="orderbook-bid-body">
<table id="orderbook-bid-table" class="orderbook-bid-table">
<thead>
<tr>
<th>TOTAL</th>
<th>SIZE</th>
<th>BID</th>
</tr>
<tbody>
<tr>
<td>1.0</td>
<td>1.0</td>
<td class="call-color">0.031</td>
</tr>
<tr>
<td>1.0</td>
<td>1.0</td>
<td class="call-color">0.031</td>
</tr>
</tbody>
</thead>
</table>
</div>
<div class="orderbook-ask-body">
<table class="orderbook-ask-table">
<thead>
<tr>
<th>ASK</th>
<th>SIZE</th>
<th>TOTAL</th>
</tr>
</thead>
<tbody>
<tr>
<td class="put-color">0.032</td>
<td>1.0</td>
<td>1.0</td>
</tr>
<tr>
<td class="put-color">0.032</td>
<td>1.0</td>
<td>1.0</td>
</tr>
</table>
</div>
</div>
</div>
<div id="stat-box" class="stat-box">
<div class="box-header">
<a class="box-title">Greeks</a>
</div>
<div class="box-body">
<table id="greek-table" class="option-modal-table">
<thead>
<tr>
<th>MARK</th>
<th>OI</th>
<th>IV</th>
<th>DELTA</th>
<th>THETA</th>
<th>VEGA</th>
<th>GAMMA</th>
</tr>
</thead>
<tbody>
<tr>
<td id="mark-greek">0.031</td>
<td id="oi-greek">1120.0</td>
<td id="iv-greek">60.9%</td>
<td id="delta-greek">-0.2</td>
<td id="thelta-greek">-9.0</td>
<td id="vega-greek">1.23</td>
<td id="gamma-greek">0.00012</td>
</tr>
</tbody>
</table>
</div>
</div>
<div id="trade-box" class="trade-box">
<div class="box-header">
<a class="box-title">Recent Trades</a>
</div>
<div class="box-body">
<table id="trade-table" class="option-modal-table">
<thead>
<tr>
<th>PRICE</th>
<th>IV</th>
<th>SIZE</th>
<th>TIME</th>
</tr>
</thead>
<tbody>
<tr>
<td>0.032</td>
<td>60.9%</td>
<td>1</td>
<td class="call-color">00:12:34</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
<script>
var optionModal = document.getElementById("option-modal");
var chartButton = document.getElementsByClassName("chartbtn");
var closeButton = document.getElementById("closebtn");
function openChart() {
optionModal.style.display = "block";
}
for (var i = 0; i < chartButton.length; i++) {
chartButton[i].addEventListener("click", openChart);
}
window.onclick = function(event) {
if (event.target == optionModal) {
optionModal.style.display = "none";
}
}
closeButton.onclick = function(event) {
if (event.target == closeButton) {
optionModal.style.display = "none";
}
}
</script>
</html>
反斜杠可能是问题所在吗
<link rel="stylesheet" type="text/css" href="/css/core-test.css" media="screen">
尝试将其更改为正斜杠。反斜杠可能是问题所在吗
<link rel="stylesheet" type="text/css" href="/css/core-test.css" media="screen">
尝试将它们更改为正斜杠。您是否尝试过使用正斜杠而不是反斜杠?
href=“\css\core test.css”
看起来可疑。打开开发工具时,您会看到什么。你有错误吗?此外,请检查“网络”选项卡。尝试查找文件未被提取的迹象。@JeffBerlin我已尝试了所有正向斜杠,但仍然不起作用。@TheTool在“开发人员工具”的“显示网络”选项卡中的任何位置都没有错误。打开“开发工具”中的“网络”选项卡,然后按住shift键刷新页面。查找红色的文件名,表示该文件未被提取。您是否尝试过使用前斜杠而不是反斜杠?href=“\css\core test.css”
看起来可疑。打开开发工具时,您会看到什么。你有错误吗?此外,请检查“网络”选项卡。尝试查找文件未被提取的迹象。@JeffBerlin我已尝试了所有正向斜杠,但仍然不起作用。@TheTool在“开发人员工具”的“显示网络”选项卡中的任何位置都没有错误。打开“开发工具”中的“网络”选项卡,然后按住shift键刷新页面。查找一个红色文件名,表示该文件未被提取。我尝试了所有正斜杠,但仍然无效。如果您只是在浏览器中直接打开HTML文件,并且该文件和CSS文件夹位于同一目录中,则应删除第一个斜杠。否则,路径将被解释为绝对路径。为了简单起见,我缩写了文件路径,因此文件路径以C:\开头,以\css\core-test.css结尾。正向斜杠和反向斜杠都不起作用。如果它们是本地的,请尝试使用相对URL。如果css文件夹与HTML文件位于同一个文件夹中,您可以将“css/core-test.css”作为css文件的路径来编写。我将href改为css\core-test.css,这就成功了。谢谢你,Lenny。我已经尝试了所有的正斜杠,但仍然不起作用。如果你只是在浏览器中直接打开HTML文件,并且该文件和CSS文件夹都位于同一目录中,你应该删除第一个斜杠。否则,路径将被解释为绝对路径。为了简单起见,我缩写了文件路径,因此文件路径以C:\开头,以\css\core-test.css结尾。正向斜杠和反向斜杠都不起作用。如果它们是本地的,请尝试使用相对URL。如果css文件夹与HTML文件位于同一个文件夹中,您可以将“css/core-test.css”作为css文件的路径来编写。我将href改为css\core-test.css,这就成功了。谢谢你,莱尼。