Reputation: 3
lately, I've been trying to code my own Tumblr blog theme. Now, I have abit of knowledge in HTML, and am quit experienced in CSS. However, I cannot seem to separate the posts in the theme. The code I am using is as follows:
<!DOCTYPE html>
<html>
<head>
<meta name="color:Background" content="#000000">
<meta name="font:Body" content="Georgia" />
<meta name="image:Background" content="http://i41.tinypic.com/wvztsk.png" />
<meta name="color:Primary Colour" content="#03999b" />
<meta name="color:Secondary Colour" content="#4cc3c5" />
<link href='https://fonts.googleapis.com/css?family=Raleway' rel='stylesheet' type='text/css'>
<title>{Title}{block:PostSummary}, {PostSummary}{/block:PostSummary}</title>
{block:Description}<meta name="description" content="{MetaDescription}" />{/block:Description}
<link rel="shortcut icon" href="{Favicon}" />
<style type="text/css">
/* Header */
.headerstuff {
background-color: black;
color: silver;
height: 25px;
width: 100%;
text-align: center;
text-decoration: none;
font-style: italic;
margin: -10px;
padding-top: 12px;
padding-bottom: -2px;
position: fixed;
font-family: 'Raleway', cursive;
}
body {
background-color:{color:Background};
font-family:{font:Body};
}
.links {
color: red;
text-align: left;
}
#content {
padding:10px;
background-color: #000000;
font-family: 'Raleway', cursive;
font-size: 25px;
max-width: 500px;
}
.contentcontainer {
width:1480px;
padding-left: 100px;
padding-top: 50px;
}
#contentcontainer #content {
background-color: white;
width: 500px;
margin: 0 auto 20px;
padding:10px;
}
#content .title {
font-family: 'Raleway', cursive;
font-size:30px;
color: silver;
padding-left: 10px;
border-bottom: 1px solid silver;
text-align: center;
}
.text {
color: white;
font-size: 20px;
font-family: 'Raleway', cursive;
padding-left: 20px;
font-style: italic;
}
</style>
</head>
<body>
<header>
<div class="headerstuff">"Welcome to Neverland!"</div>
</header>
<div class="contentcontainer">
<div id ="content">{block:Posts}
{block:Text}
{block:Title}<div class="title">{Title}</div>{/block:Title}
<div class="text">{Body}</div>
{/block:Text}
{/block:Posts}
</div>
</div>
</body>
</html>
So far I have only coded the text side of things, but as you can see in the screenshot provided, I cannot seem to separate the two text's in two seperate boxes. Anybody help?
Upvotes: 0
Views: 1791
Reputation: 523
Anything inside {block:Posts}
and {/block:Posts}
gets rendered for each post.
So to keep each post in a separate DIV
your code should be something like;
<body>
<header>
<div class="headerstuff">"Welcome to Neverland!"</div>
</header>
<div class="contentcontainer">
{block:Posts}
<div class="content">
{block:Text}
{block:Title}<div class="title">{Title}</div>{/block:Title}
<div class="text">{Body}</div>
{/block:Text}
</div>
{/block:Posts}
</div>
</body>
Then use CSS margin
for .content
to have some space in between each post.
Also remember to change #content
to .content
in you CSS.
See the documentation for more help. There is also HTML markup for a sample theme, complete with all type of post Tumblr currently supports (except Answer
post).
Upvotes: 1