Reputation: 12749
I am having trouble doing a Hello World application, and I tried to play with the CSS a bit, and it does not work, it wont update, I have no idea why. CSS isnt even included in the html when I view the source from browser (Chrome) in the dev console
<style type="text/css"></style>
and actually when I right-click, the whole and part is ommited like this
<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>
I am stuck at this and I have no idea why.
Thanks in advance!
Upvotes: 0
Views: 285
Reputation: 7552
Found answer: Missed to call @main("some title"){ here are your contents} in the page template.
Upvotes: 2