Since the font size issue seems to be a really complicated one, I started by defining a basic font for the whole document. I inserted font-family: verdana, arial, helvetica, sans-serif; and font-size: 80%; in the first section of the style sheet resulting in a code that looks like this:
html, body{
margin:0;
padding:0;
text-align:center;
background-color:#7C9D82;
font-family: verdana, arial, helvetica, sans-serif;
font-size: 80%;
}
I didn’t want to use a font size that the user can’t change, but I wanted something that works on different browsers so I used the information from the Elastic Design site. The next thing I will do is to create the styles for all the other parts of the template.
The blog title needs a font family, font size and color. More information about fonts can be found at HTML Dog. You have to create an ID for the title and use that for the header <h1> tag in your XHTML document. More information about Classes and Id’s can be found here, or from the links section in my sidebar. Information about the available font-families can be found here.
This is the style sheet code for the blog title and description:
/* Blog title and description
———————————————– */
#blog-title {
color:#B5582C;
font-family:cursive, sans-serif;
font-style:italic;
font-weight:bold;
font-size:4em;
}
#description {
color:#695838;
font-style:italic;
font-weight:bold;
font-size: 1.5em;
}
You also have to add this code to your XHTML file:
<h1 id=”blog-title”><$BlogTitle$></h1>
<p id=”description”><$BlogDescription$></p>
This is the code for the sidebar titles:
/* Sidebars
———————————————– */
.sidebar-title {
color:#B5582C;
font-weight:bold;
font-family:cursive, arial, sans-serif;
font-style:italic;
font-size:1.7em;
letter-spacing: 0.1em;
}
And this code goes in the XHTML file:
<h2 class=”sidebar-title”>Previous Posts</h2>
You can use the same code for all your sidebar titles.
This is the code for the Date Header:
/* Posts
———————————————– */
.date-header {
color:#B5582C;
font-family:cursive, arial, sans-serif;
font-style:italic;
font-weight:bold;
font-size:1.9em;
letter-spacing:.3em;
}
And this code goes in the XHTML file:
<h2 class=”date-header”><$BlogDateHeaderDate$></h2>
This is the code for the Post title:
.post-title {
font-family: cursive, arial, sans-serif;
font-style: italic;
font-size: 1.8em;
letter-spacing:.2em;
color:#020704;
}
.post-title a, .post-title strong {
color:#020704;
text-decoration:none;
}
.post-title a:hover {
color:#020704;
text-decoration:none;
background-color:#FAFFFF;
}
Code for the post body and footer:
.post-body {
line-height:1.6em;
font-size:1.2em;
}
p.post-footer {
text-align:right
}
And this code goes in the XHTML file:
<h3 class=”post-title”><BlogItemUrl><a href=”<$BlogItemUrl$>” title=”external link”></BlogItemUrl>
<$BlogItemTitle$>
<BlogItemUrl></a></BlogItemUrl></h3>
<div class=”post-body”>
<p><$BlogItemBody$></p>
</div>
<p class=”post-footer”>Posted by … </p>
Code for comments:
/* Comments
———————————————– */
#comments h4 {
font-family:cursive, arial, sans-serif;
font-style:italic;
font-size: 1.5em;
color:#B5582C;
letter-spacing:.2em;
}
And this code goes in the XHTML file:
<div id=”comments”>
<BlogItemCommentsEnabled><a name=”comments”></a>
<h4><$BlogItemCommentCount$> Comments:</h4>
…
You can find the xhtml file here and a test blog here.