简体   繁体   English

相关CSS样式表

[英]Relating CSS stylesheet

İ have already searched for a similar topic and failed on finding it. İ已经搜索了相似的主题,但找不到。 The problem i'm having is about relating my HTML file with the CSS file. 我遇到的问题是有关HTML文件和CSS文件的问题。 Before reading the code, please notice that the two sheets are on the same file and the names are properly written. 在阅读代码之前,请注意两张纸位于同一文件中,并且名称已正确书写。 It would be appreciated if you could help me notice why it doesn't work. 如果您能帮助我注意为什么它不起作用,将不胜感激。

Also, if I've done anything wrong, please don't hate. 另外,如果我做错了任何事情,请不要讨厌。

Here is the code: 这是代码:

    <html>
    <head>        
        <title>My First Website</title>  
        <meta charset="utf-8" />  
        <link rel="stylesheet" type="text/css" href="Style.css"> 
    </head>

Thank you in advance! 先感谢您!

Firstly try opening up your html file in the browser. 首先尝试在浏览器中打开您的html文件。 And then do inspect element. 然后做检查元素。 See if you can see your Style.css in the css list populated. 查看是否可以在填充的CSS列表中看到Style.css。

If you cannot access that that means either the path of your css is not correctly mentioned in the html or there is some issue with the spell if css file. 如果无法访问,则意味着html中没有正确提及css的路径,或者如果css文件中的拼写存在问题。

There is nothing wrong with your code, however you should ensure that the .CSS file is in the same directory or use dynamic references for the files. 您的代码没有任何问题,但是您应确保.CSS文件位于同一目录中,或对文件使用动态引用。 This is done by simply adding a .../CSS FILE/Styles.css for example :) 这可以通过简单地添加一个... / CSS FILE / Styles.css来完成:)

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

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