简体   繁体   English

CSS 未链接到 HTML 文件

[英]CSS not linking to HTML file

Am an actual beginner in the coding world, sorry for the poor slang.我是编码世界的真正初学者,对于糟糕的俚语感到抱歉。 I'm going through the html.net tutorial for CSS and though following the same steps as instructed my CSS file is not linking to my HTML file.我正在浏览 CSS 的 html.net 教程,尽管按照说明执行相同的步骤,但我的 CSS 文件没有链接到我的 HTML 文件。 I've put them both, the HTML File and CSS file, in the same folder called "style" on my hard drive.我把它们,HTML 文件和 CSS 文件,放在我硬盘驱动器上名为“style”的同一个文件夹中。 Am using Chrome Vertion 64.0.3282.186 (Build oficial) (64 bits).我正在使用 Chrome 版本 64.0.3282.186(官方版本)(64 位)。 Am using TextEdit on OS X Yosemite, am afraid that the issue has to do with that am using a Mac.我在 OS X Yosemite 上使用 TextEdit,恐怕这个问题与我使用的是 Mac 有关。 My brother has been doing the same tutorials in Windows and he has gotten results in some other kind of exercices while I haven't.我哥哥一直在 Windows 中做同样的教程,他在其他类型的练习中取得了成果,而我还没有。 Here's the link to the tutorial: http://html.net/tutorials/css/lesson2.php .这是教程的链接: http : //html.net/tutorials/css/lesson2.php Am including some screenshots of my coding HTML Code and CSS Code包括我的编码HTML 代码CSS 代码的一些屏幕截图

It's hard to understand what you might have done wrong, but the exercise gives the correct instructions.很难理解您可能做错了什么,但该练习给出了正确的说明。 Key points:关键点:

  • It doesn't matter what the folder is called, only that the two files are side by side in the same folder文件夹叫什么无关紧要,只要两个文件并排在同一个文件夹中即可
  • The stylesheet file should be called style.css, as this is what is referred to in the HTML file样式表文件应命名为 style.css,因为这是在 HTML 文件中引用的内容
  • It's the HTML file which links to the stylesheet file, not the other way around这是链接到样式表文件的 HTML 文件,而不是相反
  • Watch out for artefacts such as "smart quotes" which aren't the same as quotes (different opening and closing characters which look nice but don't work in a programming context)注意诸如“智能引号”之类的人工制品,它们与引号不同(不同的开始和结束字符看起来不错,但在编程上下文中不起作用)

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM