我一直在尝试将我的外部样式表链接到我的 html 一段时间,但我似乎无法实现。我将这两个文件保存在桌面上的同一个文件夹中,并且正在使用文本管理员进行编写。当我在 finder 中将其拉起时,我可以看到该页面的外观,但是当我在浏览器中打开该站点时,它只响应我的 html。
这就是我正在使用的(更新):
<!DOCTYPE html>
<html lang="en">
<head>
<title>Nathan Langer</title>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="website/style.css"/>
</head>
<header>
<h3>For proffesional and creative video and media production</h3>
</header>
<body>
<div id="name">
<h1>Nathan Langer</h1>
</div>
</body>
<footer>
<nav>
<a href="resume.html">Resume</a>
<a href="portfolio">Portfolio</a>
<a href="aboutme">What I Do</a>
</nav>
</footer>
</html>
这是我的CSS:
body {
background-image: url(images/cool.png);
background-repeat: no-repeat;
background-position: center;
}
#name {
text-align: center;
font-size: 50px;
color: white;
}
nav {
position: center;
}
nav a:hover {text-decoration:none ;}
nav a:visited {color: rgb(256,256,256) ;}
nav a:link {
text-decoration:none ;
color: rgb(256,256,256) ;
}