2017-08-09 18 views
0

我想弄清楚如何測試我的代碼如何工作,但我似乎無法弄清楚爲什麼他們不會鏈接。他們在同一個文件夾中。我也正在嘗試將Facebook像素和分析添加到此頁面。我會將該代碼嵌入到我的HTML文件中嗎?有麻煩我的樣式表與HTML文件集成

由於提前

這裏是我的代碼

的Html

<!DOCTYPE html> 

<head> 
     <title>Full Screen Landing Page</title> 
     <link href rel="stylesheet" type="text/css" href="style.css"> 
</head> 
<body> 
    <section class="intro"> 
     <div class="inner"> 
      <div class="content"> 
      <h1>Welcome To The Tribe</h1> 
      <a class="btn" href="#">Get Started</a> 
      </div> 
     </div> 
    </section> 


</body> 
</html> 

@import url('https//fonts.googleapis.com/css?family=Raleway'); 
@import url('https//fonts.googleapis.com/css?family=Oswald'); 


html, body { 
    margin: 0; 
    padding: 0; 
    height: 100%; 
    width: 100%; 

} 

.intro{ 
    height: 100%; 
    width: 100%; 
    margin: auto; 
    background: url() no-repeat 50% 50%; 
    display: table; 
    top: 0; 
    background-size: cover; 
} 

.intro .inner{ 
    display: table-cell; 
    vertical-align: middle; 
    width: 100%; 
    max-width:none; 
} 
+0

您添加HREF與出價值 – bhv

回答

0

你不應該需要有hrefrel之前,當你鏈接您的樣式表。此外,您還有一個標籤html,但沒有打開html標籤。

1

它不<link href rel="stylesheet" href="style.css">

<link rel="stylesheet" href="style.css"> 

它讀取的初始href值,因爲它是空的不讀任何CSS文件

+0

甚至這一個工程'<鏈接的rel = 「樣式的」 href = 「style.css中的」 href>',但不是這個 '<鏈接HREF相對=「樣式表「href =」style.css「>」 – bhv

0

要麼把你的自定義CSS類到style.css中文件或使用樣式標記來包含它們,同時您在鏈接標記內部具有重複的href屬性

<head> 
 
    <title>Full Screen Landing Page</title> 
 
    <link rel="stylesheet" type="text/css" href="style.css"> 
 
    <style> 
 
    html, body { 
 
     margin: 0; 
 
     padding: 0; 
 
     height: 100%; 
 
     width: 100%; 
 

 
    } 
 

 
    .intro{ 
 
     height: 100%; 
 
     width: 100%; 
 
     margin: auto; 
 
     background: url() no-repeat 50% 50%; 
 
     display: table; 
 
     top: 0; 
 
     background-size: cover; 
 
    } 
 

 
    .intro .inner{ 
 
     display: table-cell; 
 
     vertical-align: middle; 
 
     width: 100%; 
 
     max-width:none; 
 
    } 
 
    </style> 
 
</head> 
 
<body> 
 
    <section class="intro"> 
 
     <div class="inner"> 
 
      <div class="content"> 
 
      <h1>Welcome To The Tribe</h1> 
 
      <a class="btn" href="#">Get Started</a> 
 
      </div> 
 
     </div> 
 
    </section> 
 

 

 
</body>