CSS样式表未加载 [英] CSS stylesheet not loading

查看:49
本文介绍了CSS样式表未加载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是最愚蠢的问题,但是我不知道为什么我找不到问题!下面是代码,但css文件未加载.

This is the most silliest question but I dont know why I can't find the problem! Below is the code but css file is not loading.

<!DOCTYPE html>
    <html lang="en">
        <head>
            <meta charset="utf-8">
            <title>Title</title>
            <link rel="stylesheet" type="text/css" href="css/layout.css" />
        </head>
    <body>

        <section id="mainWrapper">
        <a href="#" class="btn btn-primary">Hello</a>
      </section>

    </body>

</html> 

我在浏览器中检查了源,找不到指定的文件!我试图在根目录中移动文件,并删除了仍然相同的文件夹名称.这只是我正在设计的基本模板,我无法使CSS正常工作!!!

I checked the source in the browser, it cannot find the file specified! I tried to move file in the root and removed the folder name still the same. It is just the basic template that I was designing and I can't get CSS working!!!

推荐答案

检查文件名,有时通过PC重命名时,往往会添加 layout.css.txt >将文件名更改为 .css .

Check the file name,sometimes when you rename via PC it tends to add layout.css.txt change the file name to just .css.

将文件移动到HTML所在的根目录下,暂时不会创建任何子文件夹.

Move the file to the root where you have you HTML don't create any sub-folders for time being.

请提及您是尝试上传到服务器还是只是在练习,以便我们为您提供准确的说明.

Please mention if your trying to upload to a server or just practicing,so we can give you precise instructions.

这篇关于CSS样式表未加载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆