<分区>
<分区>
几天前我开始学习 HTML。现在我试图嵌入一个 CSS 文件,它应该改变正文的字体,但它没有 ;)。
我有一个非常简单的 HTML 文件:
<head>
<meta charset="UTF-8">
<title>TEXT</title>
<meta name="description" content="Darum gehts auf der Page">
<meta name="keywords" content="fugenspachtel, silikon" >
<meta http-equiv="expires" content="0">
<style>
article {
color: green;
}
h1 {
color: blue;
}
</style>
<link rel="stylesheet" href="css/stylesheet.css">
</head>
<body>
<header>
<h1 style="color: red">TEXT <br> <span>TEXT</span></h1>
</header>
<section>
<article>
<p>TEXT</p>
<img src="images/spachtel1.jpg"><br>
<img src="images/spachtel1.jpg"><br><br>
</article>
</section>
<footer>
<h3>text<br>
</footer>
</body>
这是带有主体颜色的 CSS 文件:
@font-face {
font-family: 'alex_brushregular';
src: url('alexbrush-regular-webfont.eot');
src: url('alexbrush-regular-webfont.eot?#iefix') format('embedded-opentype'),
url('alexbrush-regular-webfont.woff2') format('woff2'),
url('alexbrush-regular-webfont.woff') format('woff'),
url('alexbrush-regular-webfont.ttf') format('truetype'),
url('alexbrush-regular-webfont.svg#alex_brushregular') format('svg');
font-weight: normal;
font-style: normal;
}
body {
font-family: 'alex_brushregular', 'sans-serif';
}
我有一个元素文件夹,在该文件夹中还有一个名为 CSS 的文件夹。在该文件夹内有所有不同格式的字体(例如 .ttf、.eot 等)。
文件夹结构如下: http://i.imgur.com/tM5Cvko.png
最佳答案
你错过了样式表末尾的字母 s
,使用
<link rel="stylesheet" href="css/stylesheets.css">
代替
<link rel="stylesheet" href="css/stylesheet.css">
关于html - 无法将 CSS 文件连接到 HTML 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37037463/