2
我工作的一個項目,我基本上是複製並粘貼一些代碼,我之前,我知道的工作做了。唯一的區別是,現在,index.html
和index.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文件正確鏈接和正確顯示。任何想法,爲什麼這可能是?
過關,路徑的CSS是正確的? – Swellar
@Swellar是的。所有的CSS,但是ID正在被應用。 –
它看起來像是在 – Swellar