【发布时间】:2019-04-30 18:04:52
【问题描述】:
我遵循了这篇文章中的每一个建议:CSS Background image not loading
但我的图片没有在后台加载。
这是我的css/style.css:
body {
font-family: 'Lucida Grande', 'Helvetica', sans-serif;
background-image: url(../assets/corkboard.jpg);
}
我正在将它加载到我的index.html 文件中,该文件位于项目的根目录中:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>notepad</title>
<link rel="stylesheet" href="css/style.css" type="text/main">
</head>
<body>
<button type="button" name="button" id="newNoteButton" onclick="newNote()">Add New Note</button>
<script type="text/javascript" src="js/script.js"></script>
</body>
</html>
我的图片位于名为 assets 的文件夹中。
【问题讨论】: