CSS Date Blocks for Blogs
You've probably been seeing the little date blocks that people have started using recently in their blog designs (even if you didn't notice them).
Example:
I've seen a few instances and explanations of these that go to lengths as extensive as generating images on the fly. That's totally overkill for what 3 little DIV tags and a couple of CSS classes can accomplish. You also gain the fact that your date information will actually be present in your HTML.
The CSS:
.dateblock {
text-align: center;
width: 50px;
font-family: Arial;
}
.day {
font-size: 26px;
position: relative;
top: -5px;
}
.month {
font-size: 12px;
}
.year {
font-size: 12px;
position: relative;
top: -10px;
}
Example HTML
<div class="dateblock">
<div class="month">
SEP
</div>
<div class="day">
05
</div>
<div class="year">
2005
</div>
</div>
Extending it
One obvious extension would be to make the dateblock container float:left next to, say, a blog post. The result would be something along the lines of a dropcap for your date. The CSS numbers for pixel alignment, sizes, etc. are tied to the font chosen. If you chose another font (and I will for my own instances) the numbers will change.
Another intriguing option would be to use the sIFR web fonts to get out of the default fonts available on the web. It would take some trial and error to get the sizing right, but then you'd be able to use nearly any font you like.
A border and appropriate padding on the container will look like this (mouseover extended examples to see the combined HTML/CSS):
Throw in a background and inverted colors and you get:
Change the color and you can match whatever site theme you are after:

September 8th, 2005 at 9:00 am
Very nice!
September 13th, 2005 at 2:07 pm
[...] css date blocks for blogs [...]
November 3rd, 2005 at 4:10 pm
[...] Tricks by J. Wynia: Using CSS to create date blocks . Putting fake postit notes on a resume. Using mindmaps/freemaps to outline creative ideas. [...]
September 27th, 2006 at 7:34 pm
Thank you so much!
It helped me a lot.
God bless.
October 9th, 2006 at 9:40 am
Used this on my blog site. Thanks.
March 13th, 2007 at 10:25 pm
nice and simple ^^
September 6th, 2007 at 8:17 pm
sweet, just what i was looking for thanks!
March 22nd, 2008 at 5:39 pm
Hello everybody, my name is Damion, and I'm glad to join your conmunity,
and wish to assit as far as possible.