CSS没有链接到我的index.html

时间:2015-03-01 18:04:37

标签: html css indexing stylesheet

我是这方面的初学者,所以我为此道歉,因为我自学了,所以请给我一些懈怠。我在将CSS链接到索引时遇到了问题,我试图做的就是将页面顶部的certian部分设置为黑色,就像一个刚填充黑色的框。横幅区域技术上。它由于某种原因没有链接?这是CSS和HTML代码 - 我尝试在Chrome和资源管理器中打开,但没有发生任何事情?请帮忙。



/*! normalize.css v3.0.1 | MIT License | git.io/normalize */
html {
    font-family: volkorn;
    -ms-text-size-adjust: 100%;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
}

.top-section {
    padding: 30px 0;
    margin-bottom: 0;
    color: #000000;
    background-color: #000000;
    background-size: cover;
}

.top-section {
padding-top: 100px;
padding-bottom: 100px;
}   

<!DOCTYPE html>
<!--[if lt IE 7 ]> <html class="ie6" lang="en"> <![endif]-->
<!--[if IE 7 ]>    <html class="ie7" lang="en"> <![endif]-->
<!--[if IE 8 ]>    <html class="ie8" lang="en"> <![endif]-->
<!--[if (gte IE 9)|!(IE)]><!--> <html lang="en"> <!--<![endif]-->
<title>Upload Festival</title>  
    <head>
  
      <!-- Meta -->
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="keywords" content="">
    <meta name="author" content="">
    <meta name="googlebot" content="index,follow">
        
    <!--css-->
    <link href="css/customization.css" rel="custom" style="text/css">
  </head>
<body class="index">
<header class="top-section" role="banner"></header>
</body>
</html>
&#13;
&#13;
&#13;

2 个答案:

答案 0 :(得分:2)

我是初学者,然后从简单的基本概念开始......
使用此模板是HTML页面的结构:

<html>
    <head>

        <title>Page Title</title>
        <!--Link to an external resource-->
        <link rel="stylesheet" type="text/css" href="css-folder/css-file.css">

    </head>
    <body>
        <header class="top-section" role="banner"></header>
    </body>
</html>

将您的style sheets放入另一个文件中。例如:

css-folder / css-file.css:

html {
    font-family: volkorn;
    -ms-text-size-adjust: 100%;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
}

.top-section {
    padding: 30px 0;
    margin-bottom: 0;
    color: #000000;
    background-color: #000000;
    background-size: cover;
}

.top-section {
    padding-top: 100px;
    padding-bottom: 100px;
}   

您现在无需了解conditional commentsdoctypes以及meta datas! 祝你好运。

答案 1 :(得分:1)

在rel属性和style属性(不存在)中,CSS链接似乎存在问题。 你有这个:

<link href="css/customization.css" rel="custom" style="text/css">

它应该是这样的:

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

有关将CSS文件链接到您自己的网站的更多信息: http://www.w3schools.com/css/css_howto.asp

有关LINK标记的更多信息: http://www.w3schools.com/tags/tag_link.asp

度过美好的一天!