由于某种原因,这个CSS不会影响HTML。在我调试它的网站上,它表示CSS已加载,但在样式窗格中它没有显示。
<head>
<link rel="stylesheet" href="https://raw.githubusercontent.com/jonsuh/hamburgers/master/dist/hamburgers.css">
</head>
<body>
<button class="hamburger" type="button">
<span class="hamburger-box">
<span class="hamburger-inner"></span>
</span>
</button>
</body>
答案 0 :(得分:5)
使用下面的网址!
原因(由Mr.Lister提供):
第一个链接是文本文件(类型为text / plain),而不是 可识别为样式表!
<强>之前:强>
<link rel="stylesheet" href="https://raw.githubusercontent.com/jonsuh/hamburgers/master/dist/hamburgers.css">
<强>后:强>
<link rel="stylesheet" href="https://rawgit.com/jonsuh/hamburgers/master/dist/hamburgers.css">
<head>
<link rel="stylesheet" href="https://rawgit.com/jonsuh/hamburgers/master/dist/hamburgers.css">
</head>
<body>
<button class="hamburger" type="button">
<span class="hamburger-box">
<span class="hamburger-inner"></span>
</span>
</button>
</body>
&#13;
答案 1 :(得分:2)
通常这样尝试你添加的git样式链接不能用作cdn链接。因此,使用rawgithub.com域来检索您的css文件。
<head>
<link rel="stylesheet" type="text/css" href="https://rawgithub.com/jonsuh/hamburgers/master/dist/hamburgers.css">
</head>
<body>
<button class="hamburger" type="button">
<span class="hamburger-box">
<span class="hamburger-inner"></span>
</span>
</button>
</body>
&#13;