简体   繁体   English

在 GitHub Pages 中看到 CSS 和 JS 时出现问题,但在 VS Code 中运行良好

[英]Problems seeing CSS and JS in GitHub Pages, but working well in VS Code

I am working in a page for a project and I used a template that included CSS and JS files.我在一个项目的页面上工作,我使用了一个包含 CSS 和 JS 文件的模板。 I worked the code in Visual Studio Code and it worked well locally in my computer.我在 Visual Studio Code 中编写代码,它在我的计算机本地运行良好。 I used GitHub Pages in order to share it but there are elements missng like the button to show/hide the menu, the background, and arrows.我使用 GitHub Pages 来分享它,但缺少一些元素,例如显示/隐藏菜单的按钮、背景和箭头。

Here is my repository https://github.com/azu-any/reafo.git这是我的存储库https://github.com/azu-any/reafo.git

This is how it should look: Using VS Code它应该是这样的:使用 VS 代码

And how it looks using GitHub: GitHub Pages以及使用 GitHub 的外观: GitHub Pages

Thanks in advance!提前致谢!

PS.附言。 I've already checked the url's and they work fine, otherwise other styles would not function.我已经检查了 url,它们工作正常,否则其他样式将无法运行。

Files with names starting with underscore, like _styles_js.js are blocked in GitHub Pages .名称以下划线开头的文件,如_styles_js.js在 GitHub Pages 中被屏蔽

You have two options:你有两个选择:

  1. Create an empty .nojekyll file in the root of your repository在存储库的根目录中创建一个空的.nojekyll文件
  2. Get rid of _ prefix from filenames从文件名中去掉_前缀

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 为什么我的 CSS/JS 不能在 Github 页面上运行? - Why is my CSS/JS not working on Github pages? GitHub 页面未加载 js 或 css - GitHub pages not loading js or css 我的 Github 页面站点中的 JS 代码出现问题,按钮不起作用 - Having trouble with JS code in my Github pages site, buttons not working 在Github页面引用CSS和JS文件? - Referencing CSS and JS file in Github Pages? CSS 的某些部分在 GitHub 页面中不起作用 - Some part of CSS not working in GitHub pages 我在 Github Pages 上部署的 CRA 网站似乎无法正常工作,因为它在我使用 VS Code 时在我机器上的本地主机上工作 - My deployed CRA website on Github Pages seems to be not working as it is working on localhost on my machine when i was using VS Code 为什么我的 web 页面在应用 CSS styles 之前呈现原始 html - 两者都通过 Visual Studio Code 在本地和 Firefox 以及托管在 github 上? - why do my web pages render raw html before applying CSS styles - both locally via Visual Studio Code & Firefox as well hosted on github? 网络托管:GitHub页面不显示HTML,CSS和JS文件 - Web Hosting: GitHub Pages Not Displaying HTML, CSS, and JS Files Jquery 在 github 页面中不起作用 - Jquery not working in github pages js代码在控制台中工作,但不在vs代码中 - js code working in console but not in vs code
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM