gpt4 book ai didi

JavaScript 文件不适用于 HTML

转载 作者:行者123 更新时间:2023-11-28 19:04:15 25 4
gpt4 key购买 nike

我正在尝试使用显示的“转换器选项卡”here.

我的代码如下:

<head>

<link href="tabs.css" rel="stylesheet" >
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script>
<script src="tabs.js"></script>

</head>

<body>
<div class="tabs">

<nav role='navigation' class="transformer-tabs">
<ul>
<li><a href="#tab-1">Important Tab</a></li>
<li><a href="#tab-2" class="active">Smurfvision</a></li>
<li><a href="#tab-3">Monster Truck Rally</a></li>
<li><a href="http://google.com">Go To Google &rarr;</a></li>
</ul>
</nav>

<div id="tab-1">
<h2>Tab 1</h2>
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ad cum non iure magnam dolores earum nemo quo tempora ab unde! Nesciunt ea iste impedit suscipit cupiditate quam earum explicabo quas veniam doloribus sed aut aliquam repellendus deleniti laudantium molestias fuga nihil quidem voluptatum atque sapiente perferendis facilis. Tempora mollitia odio?
</div>

<div id="tab-2" class="active">
<h2>Tab 2</h2>
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Consequuntur est natus esse minima nihil quidem tenetur alias pariatur. Obcaecati repudiandae temporibus provident sapiente iure doloribus praesentium voluptates dolores quia eos velit fugit cum ipsam. Deleniti fugiat maxime vel tempore illum esse illo fugit quam recusandae aut aperiam omnis at quaerat!
</div>

<div id="tab-3">
<h2>Tab 3</h2>
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Maiores numquam cupiditate aliquam quisquam repellendus fugit eaque asperiores voluptatem ut accusamus soluta corporis in facere quae provident itaque magni eum repellat ducimus dolore. Beatae aperiam accusamus at voluptatem ad sunt mollitia perspiciatis tempora numquam rerum aliquam deserunt illum necessitatibus nisi omnis.
</div>

<div id="tab-4">
<h2>Tab 4</h2>
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Iste officiis impedit ut culpa quaerat error pariatur voluptatum sapiente alias quasi itaque voluptas expedita necessitatibus odio dolorem totam veniam quisquam nulla vero placeat corporis cupiditate assumenda amet inventore mollitia quidem similique laudantium maxime aperiam ea reprehenderit iusto a ad tempora harum.
</div>

</div>

</body>

“tabs.css”和“tabs.js”位于同一目录中。虽然应用了“tabs.css”,但未应用“tabs.js”,结果只是一个没有选项卡的线性页面。 enter image description here

我尝试过使用和不使用jquery,并将脚本手动插入到正文的头部和末尾。 JS 和 CSS 文件是从工作示例中精确复制的。我的浏览器启用了 JavaScript。脚本文件肯定是上传到服务器了。我在这里感到非常困惑,尽管我怀疑这个问题可能有些愚蠢。

最佳答案

这里的问题是你的css文件,正确检查示例链接,他们使用的不是正常的css,它的scss。所以你首先需要将你的scss文件编译为css然后你就可以使用它了。

How to include SCSS file in HTML

您可以从此链接获取帮助

关于JavaScript 文件不适用于 HTML,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31995379/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com