我在做一个 Hello World 应用程序时遇到了麻烦,我尝试了一下 CSS,但它不起作用,它不会更新,我不知道为什么。当我在开发控制台中从浏览器(Chrome)查看源代码时,CSS 甚至不包含在 html 中
<style type="text/css"></style>
实际上,当我右键单击时,整个和部分都像这样被省略
<h1>My Blog</h1>
<ul>
<li>
<h2>
<a href="/posts/1" >Post #1</a>
</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis a pulvinar massa. Nullam gravida rhoncus quam non aliquam. Donec vitae orci at nibh scelerisque.</p>
</li>
<li>
<h2>
<a href="/posts/2" >Post #2</a>
</h2>
<p>Suspendisse leo ante, ornare et ultrices nec, commodo vitae neque. Proin dictum diam quis nibh elementum et consequat ipsum aliquam. Vestibulum ante ipsum.</p>
</li>
</ul>
<form action="/posts/create" method="POST" >
<input type="text" name="title" /> </br>
<input type="text" name="content" /> </br>
<input type="submit" value="Post" />
</form>
main.css
p {
background-color: #FFAABB;
}
main.scala.html
@(title: String)(content: Html)
<!DOCTYPE html>
<html>
<head>
<title>@title</title>
<link rel="stylesheet" media="screen" href="@routes.Assets.at("stylesheets/main.css")">
<link rel="shortcut icon" type="image/png" href="@routes.Assets.at("images/favicon.png")">
<script src="@routes.Assets.at("javascripts/jquery-1.7.1.min.js")" type="text/javascript"></script>
</head>
<body>
@content
</body>
</html>
我被困在这里,我不知道为什么。
提前致谢!