html - CSS 未导入 HTML

标签 html css background stylesheet grid-system

我一定很累了。 CSS 不会导入到 HTML 中。显示的全部内容是:测试测试测试(在不同的行上)此外,在网格 CSS 中只有 920.gs:

<!DOCTYPE html>
<html>
        <head>
            <title>Some title</title>
        <link rel="stylesheet" type="text/css" href="/css/styles.css" />
    </head>
    <body>
        <div class="container_12" id="content">
            <div class="grid_3" id="leftside">
                <h1>Test</h1>
            </div>
            <div class="grid_6">
                <h1>Test</h1>
            </div>
            <div class="grid_3" id="rightside">
                <h1>Test</h1>
            </div>
        </div>
    </body>
</html>    

添加 CSS:

@import url("http://fonts.googleapis.com/css?family=Days+One&effect=font-effect-fire-                         animation");
@import url("css/grid.css"")

body {
        background-attachment:fixed;
    background-repeat:no-repeat;
    background-color:#7FA8FF;
    background-position:top;
    background-image:url("../images/background.png");
    text-align: center; 
    font-family: 'Days One', sans-serif;
}

最佳答案

尝试从 css 路径中删除前导斜杠:

<link rel="stylesheet" type="text/css" href="css/styles.css" />

这将假设您的网络应用程序的根目录下有一个 css 文件夹,与 HTML 页面处于同一级别。

关于html - CSS 未导入 HTML,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14226169/

相关文章:

javascript - 验证在 HTML 中不起作用

php - 如何显示我上传到服务器文件夹中的图像?我使用的是php和mysql,数据库中只保存图片的名称

html - 处理草图不适用于网络

php - 如何将 Open Sans 字体添加到 mpdf 文档

android - 更改按钮android :background to different drawable

r - 在ggplotly线图中填充背景间隔

javascript - 如何测试 DOM 中是否存在包含链接 href 的 HTML 链接元素 (a)?

html - 带字母间距的输入大小

javascript - 使用 html 在网页中显示 PowerPoint 演示文稿

IOS uitableview单元格选中背景