index.html 和 style.css 在我的本地机器上用于练习编码。
Chrome 和 Safari 可以正确呈现 CSS,但 FireFox 29 不能。 Firefox 识别 css 文件,但不呈现它。我在另一台机器上试过,但仍然遇到同样的问题。
我已经验证了我的代码并且没有错误。我是否遗漏了任何阻止它在 Firefox 中呈现的标签?
<!DOCTYPE html>
<html>
<head>
<meta charset= "utf-8">
<link rel="stylesheet" type="test/css" href="style.css">
<title>Welcome!</title>
</head>
<body>
<div id="pagewrap">
<!-- Top Head of My Page -->
<div id="header">
<nav id="nav">
<a href="./index.html" id=logo><img src="#" alt="yo"></a>
<div id="socialnetwork">
<a href="#" id="linkicon"><img src="./Social_Icons/Linkedin.png" alt="LinkedIn"></a>
<a href="#" id="fbicon"><img src="./Social_Icons/facebook.png" alt="FB"></a>
<a href="#" id="igicon"><img src="./Social_Icons/Instagram.png" alt="InstaGram"></a>
<a href="#" id="twittericon"><img src="./Social_Icons/Twitter.png" alt="Twitter"></a>
<a href="#" id="skypeicon"><img src="./Social_Icons/Skype.png" alt="Yelp"></a>
<!-- Icons from Dribble by Dawid Dapszus https://dribbble.com/dashoo-->
</div>
<!-- End of Social Network Links-->
<ul>
<li><a href="./index.html" class="navlink">Home</a></li>
<li><a href="./aboutme.html">Portfolio</a></li>
<li><a href="./resume.html">Resume</a></li>
<li><a href="./aboutme.html">About Me</a></li>
<li><a href="./contact.html">Contact </a></li>
</ul>
</nav>
</div>
</div>
<!--End of Page Wrap -->
</body>
</html>
body {
font-family:'Century Gothic', sans-serif;
}
a {
text-decoration: none;
}
#pagewrap {
width:950px;
margin: 0 auto;
}
#socialnetwork {
padding-top: 100px;
float:right;
}
#socialnetwork img{
height:30px;
}
#nav ul{
text-align: left;
border-bottom: groove;
}
#nav li{
margin:0 15px 0 0;
display: inline;
}
#nav li a:link{
color:#868686;
}
#nav li a:visited{
color:#868686;
}
#nav li a:hover{
color:#324EDC;
}
#nav li a:active{
color:#324EDC;
}
最佳答案
您在链接标签属性值中输入了错误的词,您输入的是“test/css”而不是“text/css”
您的标签:
<link rel="stylesheet" type="test/css" href="style.css">
更新标签:
<link rel="stylesheet" type="text/css" href="style.css">
关于html - CSS 在 Firefox 上加载但不呈现,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24074436/