2017-06-16 16 views
2

我工作的一個項目,我基本上是複製並粘貼一些代碼,我之前,我知道的工作做了。唯一的區別是,現在,index.htmlindex.css位於不同的文件夾中。 CSS正在應用,但底部的ID不是由於某種原因。不過,如果你在這個網站上預覽它,那就完全沒問題。沒有應用我的ID

/* 
 
font-family: 'Dosis', sans-serif; 
 
font-family: 'Chewy', cursive; 
 

 
HEX: #fff2df 
 
HEX: #d9ad7c 
 
HEX: #a2836e 
 
HEX: #674d3c 
 
*/ 
 

 
body { 
 
    font-family: 'Dosis', sans-serif; 
 
    background: #fff2df; 
 
} 
 

 

 
/* Matan's Website */ 
 

 
h1 { 
 
    font-family: 'Chewy', cursive; 
 
    font-size: 65px; 
 
    text-align: center; 
 
} 
 

 

 
/* Line */ 
 

 
hr { 
 
    width: 600px; 
 
    border-style: solid; 
 
    margin-top: -15px; 
 
} 
 

 

 
/* All Boxes */ 
 

 
ul { 
 
    overflow: hidden; 
 
    text-align: center; 
 
} 
 

 
li { 
 
    float: center; 
 
    text-align: center; 
 
    display: inline-block; 
 
} 
 

 
a { 
 
    background-color: #000; 
 
    border-radius: 20px; 
 
    z-index: 100; 
 
} 
 

 
.buttons { 
 
    list-style-type: none; 
 
    margin: 0; 
 
    padding: 0; 
 
    text-align: center; 
 
    width: 100%; 
 
} 
 

 
.links { 
 
    font-size: 37.5px; 
 
    text-decoration: none; 
 
    display: inline-block; 
 
    text-align: center; 
 
} 
 

 

 
/* Individual Boxes */ 
 

 
#word { 
 
    background-image: url('Pictures/word.jpg'); 
 
    background-repeat: no-repeat; 
 
    background-size: cover; 
 
    background-position: 50% 50%; 
 
    padding: 162.75px 119.25px; 
 
    margin: 65px 75px 0px 0px; 
 
    color: #fff; 
 
    transition: all 0.5s ease-out; 
 
} 
 

 
#word:hover { 
 
    padding: 189.875px 139.125px; 
 
    transition: all 0.5s ease-out; 
 
    opacity: 0.8; 
 
    margin-right: 63.4px; 
 
    margin-left: -28.125px; 
 
    margin-top: 37.875px; 
 
} 
 

 
#pwpoint { 
 
    background-image: url('Pictures/powerpoint.jpg'); 
 
    background-size: cover; 
 
    background-position: center; 
 
    background-repeat: no-repeat; 
 
    padding: 162.75px 69.75px; 
 
    margin: 65px 75px 0px 0px; 
 
    color: #fff; 
 
    transition: all 0.5s ease-out; 
 
} 
 

 
#pwpoint:hover { 
 
    padding: 189.875px 81.375px; 
 
    transition: all 0.5s ease-out; 
 
    opacity: 0.8; 
 
    margin-right: 63.275px; 
 
    margin-left: -11.5px; 
 
    margin-top: 37.875px; 
 
} 
 

 
#ptshop { 
 
    background-image: url('../Pictures/photoshop.jpg'); 
 
    background-size: cover; 
 
    background-position: center; 
 
    background-repeat: no-repeat; 
 
    padding: 162.75px 99px; 
 
    margin: 65px 0px 0px 0px; 
 
    color: #fff; 
 
    transition: all 0.5s ease-out; 
 
} 
 

 
#ptshop:hover { 
 
    padding: 189.875px 115.5px; 
 
    transition: all 0.5s ease-out; 
 
    opacity: 0.8; 
 
    margin-right: -28.125px; 
 
    margin-left: -4.9px; 
 
    margin-top: 37.875px; 
 
}
<!DOCTYPE html> 
 
<html> 
 

 
<head> 
 
    <title>Portfolio</title> 
 
    <link rel="stylesheet" type="text/css" href="../index.css"> 
 
    <link href="https://fonts.googleapis.com/css?family=Chewy|Dosis" rel="stylesheet"> 
 
</head> 
 

 
<body> 
 
    <h1>My Portfolio</h1> 
 
    <hr> 
 
    <div class="allbuttons"> 
 
    <ul class="buttons"> 
 
     <li><a class="links" id="word" href="Word/index.html">Word</a></li> 
 
     <li><a class="links" id="pwpoint" href="Powerpoint/index.html">Powerpoint</a></li> 
 
     <li><a class="links" id="ptshop" href="Photoshop/index.html">Photoshop</a></li> 
 
     <li><a class="links" id="other" href="Other/index.html">Other</a></li> 
 
    </ul> 
 
    </div> 
 
</body> 
 

 
</html>

的ID都沒有工作,但CSS文件正確鏈接和正確顯示。任何想法,爲什麼這可能是?

+0

過關,路徑的CSS是正確的? – Swellar

+0

@Swellar是的。所有的CSS,但是ID正在被應用。 –

+0

它看起來像是在 – Swellar

回答

1

「消除所有其他因素,剩下的一定是真相的人。」

福爾摩斯frequently pointed out,尋找真相時(在這種情況下,一個解決方案),我們必須先消除雜波。

Relative vs. Absolute URLs是準確的時候方便,而且容易出錯的a variety of reasons

一個整潔的工作空間是非常寶貴的;編寫任何項目時,請創建並維護a controlled and suitable space以幫助避免和診斷可能出現的問題。

...

其他輕度光顧的陳詞濫調可應要求提供;-)

相關問題