Q: How can i style date that dynamicaly reading from database? dynamical reading date from database in codeigniter like given below
<?php echo format_date($row['date'], 'd M')?>

and the result will disply like 27 Jul
I want to style it to like this image http://line25.com/wp-content/uploads/2012/date-icon/16.jpg
How can i style like this image please help..

A: I'm afraid it can't be done with CSS alone. The main problem is that the components of the date do not appear as elements in the markup, so you cannot style them differently from each other, except to a limited degree. By setting a width that forces them to different lines, you get the opportunity to use :first-line. But the possibilities of styling that pseudoelement are rather limited, by the specs and in practice.
So you would need to modify the generating code to produce something like
<span class=date><span class=day>27</span><span class=month>Jul</span></span>

Then you can e.g. style such an element as an inline block and the inner span elements as blocks and set background and content colors, font properties, and rounded border for the outer element.
