作为初学者,我在 meteor 中运行了 simple-todos 应用程序,它运行良好,现在我在 main.html 中做了一些小修改,如下所示
<head>
<title>mywebapp</title>
</head>
<style>
body
{
background-image: url("mainimage.jpg");
}
</style>
<body>
<h1>Development in progress</h1>
</body>
但是当我刷新页面时,我看到下面的错误
Errors prevented startup:
While processing files with templating-compiler (for target web.browser): client/main.html:1: Expected one of:
<body>
,<head>
,<template>
Your application has errors. Waiting for file change.
我对这个错误没有任何线索。谁能告诉我这是什么问题?
主.css
/* CSS declarations go here */
<style>
body
{
background-image: url("mainimage.jpg");
}
</style>
最佳答案
在 css 文件中定义样式,而不是 <style>
阻止你的html。您甚至不需要导入 css 文件,Meteor 会自动包含它。
关于javascript - 使用模板编译器处理文件时(针对目标 web.browser),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47036400/