0 users
Search

Thursday, March 27, 2008

Nice comments counter style for your blog post

0 users

This post illustrates how to design a nice comments counter for your blog post and obtain an elegant post header using just some lines of CSS code. This is the result:



You can download the source code and use it immediatly on your blog.

Download source code

Counter structure
The following picture explains how to design our comments counter:




We have a main DIV which includes a <span> element (with class attribute = "count") which displays the number of comments for the current post and, below it, the text "comments". I prepared this image to for the DIV background using Photoshop:


I'll apply this image to background attribute in the CSS definition.


HTML and CSS Code
This is our HTML code:

<div class="bubble">
<span class="count">... counter ...</span>
comments
</div>

...and this is the CSS code:

.bubble{
background:url(img/bubble.png) left top no-repeat;
color:#575553;
float:left;
font-family:Verdana, Arial, Helvetica, sans-serif;
font-size:9px;
height:68px;
margin-right:20px;
padding-top:7px;
text-align:center;
width:70px;
}
.bubble .count{
font-family:Georgia, "Times New Roman", Times, serif;
font-size:24px;
color:#CC6600;
}

It's all! Nothing simpler :)

Sponsored Links

8 comments

Mostly Lisa said...

Ohh. i really like this. It would go really nice with my comments. Thanks. I'll get on it.

PS. Dugg.

Anonymous said...

Hello,
Would you please post an article about making templates for new version of blogger?
Something like your template
Regards.

SeoScout said...

very nice. i'll try it myself and i'll republish it (german) at my blog and give credit to you.

Nitos said...

LOL.. anonymous.. I told antonio to do it.. there's two! :D..
Love this post going to use it on my blog thanks antonio (as always)

Ginger M said...

This is really cool. Found you via stumbleupon.
Cheers,
M

Abhisek said...

Thanks for the tips.
@anonymous, I second that! ;)

Yogesh Agrawal said...

Hi, It is really nice, but could you tell me how should I use this code, I blog on blogger, I didn't get how to use the code.

bihi said...

very cool. thx

Facebook | Feeds rss About Me

Antonio Lupetti
Engineer, Pro Blogger, Mac user, Musician, Web Addicted.
ROME - ITALY antonio.lupetti@gmail.com

Subscribe feeds rss Feed RSS

Your Email (Subscribe my feed via e-mail)

Recent Entries

What's new on woork...

Twitter

What I'm doing?

Categories and Links

Categories

Browse this blog for topic...

Social Networks

My Social Networks identity...

Table of content

Did you miss something? Thake a look at my table of content.
Read more...

Advertising

How to promote a site, a product or a service on woork
Read more...

Buy a review Site reviews

Technorati Authority

Technorati
Woork authority on technorati
Add this blog to your faves
View blog authority