gpt4 book ai didi

javascript - 垂直制表符在 github 上显示不正确

转载 作者:行者123 更新时间:2023-11-28 04:50:48 26 4
gpt4 key购买 nike

我在 test.html 中编写了一个垂直制表符,当我使用浏览器从我的硬盘驱动器打开它时,它就可以工作了。它看起来像这样:

Correct display

但是当我使用github打开网页时,它不再正常显示。变成这样:

Wrong display

请问是什么问题?这是我的代码:

<script>
function openFood(evt, foodName)
{
var i, x, tablinks;
x = document.getElementsByClassName("food");
for (i = 0; i < x.length; i++)
{
x[i].style.display = "none";
}
tablinks = document.getElementsByClassName("tablink");
for (i = 0; i < x.length; i++)
{
tablinks[i].className = tablinks[i].className.replace(" w3-red", "");
}
document.getElementById(foodName).style.display = "block";
evt.currentTarget.className += " w3-red";
}
</script>

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Test</title>
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="css/style.css">
<link href='https://fonts.googleapis.com/css?family=Oxygen:400,300,700' rel='stylesheet' type='text/css'>
<link href='https://fonts.googleapis.com/css?family=Lora' rel='stylesheet' type='text/css'>
<link href='http://www.w3schools.com/lib/w3.css' rel='stylesheet' type='text/css'>
</head>

<nav class="w3-sidenav w3-light-grey w3-card-2" id="size">
<div class="w3-container">
<h5><b>Category</b></h5>
</div>
<a href="javascript:void(0)" class="tablink" onclick="openFood(event, 'Rice')">Rice</a>
<a href="javascript:void(0)" class="tablink" onclick="openFood(event, 'Noodles')">Noodles</a>
<a href="javascript:void(0)" class="tablink" onclick="openFood(event, 'Chicken')">Chicken</a>
<a href="javascript:void(0)" class="tablink" onclick="openFood(event, 'Beef')">Beef</a>
</nav>

最佳答案

我发现了问题。由于加密薄弱,我的浏览器阻止了部分页面。

view

关于javascript - 垂直制表符在 github 上显示不正确,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40715801/

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