9lessons programming blog
Loading Search
Monday, December 20, 2010

Status Message Design with CSS

I received lot of requests from my readers that asked to me how to design Twitter and Facebook like status message(image + text) with CSS. So that I had presented a very basic level CSS tutorial with Div and Ol tags, truly it's for CSS beginners. I hope you like this. Thanks!

Status Messages Design with CSS

Download Script     Live Demo

Status message box divided into three parts are (1) Body, (2) Image and (3) Text.

Status Messages Design with CSS

HTML Code
Here stbody, stimg and sttext are class names of Body, Image and Text div tags respectively.
<div class="stbody">

<div class="stimg">
2 Image Part
</div>

<div class="sttext">
3 Text Part
</div>

</div>

Status Messages Design with CSS

CSS Code
word-wrap:break-work for text justification.
.stbody
{
min-height:70px;
margin-bottom:10px;
border-bottom:dashed 1px #cc0000;
}
.stimg
{
float:left;
height:50px;
width:50px;
border:solid 1px #dedede;
padding:5px;
}
.sttext
{
margin-left:70px;
min-height:50px;
word-wrap:break-word; // Text justification
overflow:hidden;
padding:5px;
display:block;
font-family:'Georgia', Times New Roman, Times, serif
}

Status Messages Design with CSS

HTML Code
<div class="stbody">

<div class="stimg">
<img src="sri.jpg" />
</div>
<div class="sttext">
9lessons programming blog <a href="http://www.9lessons.info">http://9lessons.info</a>
<div class="sttime">2 seconds ago</div>
</div>

</div>

Order List Tag
I suggest you do with order list tag it's very flexible for jquery animation effects.
<ol>
// Loop Start
<li class="stbody">
<div class="stimg">
<img src="sri.jpg"/>
</div>
<div class="sttext">
9lessons programming blog http://9lessons.info
<div class="sttime">2 seconds ago</div>
</div>
</li>
//Loop End
</ol>

CSS Code
ol
{
list-style:none;
margin:0px;
padding:0px;
}
.stbody
{
min-height:70px;
margin-bottom:10px;
border-bottom:dashed 1px #cc0000;
}
.stimg
{
float:left;
height:50px;
width:50px;
border:solid 1px #dedede;
padding:5px;
}
.sttext
{
margin-left:70px;
min-height:50px;
word-wrap:break-word;
overflow:hidden;
padding:5px;
display:block;
font-family:'Georgia', Times New Roman, Times, serif
}

Share this post

Comments
{ 13 comments }
Buzzknow said...

It's really nice like usual :)

regards

tito cheriachan said...

superb code Srinivas , u have explained everything in its simplest way. I previously used
Delete Records with Color Change Effect using jQuery and Ajax , now I am going to try out this one too..thanks..But u dont blog frequently..i wud i want some tips on a weekly basis..

Luis Santos said...

It'd be awesome if you could make something to reply to the messages. Then the replied message would be a little shorter and above the original message.

Thanks mate =)

Anonymous said...

.sttext for this class u have used display:block is this required mate....

Web Design said...

Excellent CSS tutorial, thanks for code support, I clear the basics of CSS. Thanks for sharing... :)

Dias, Victor said...

u rock man. Just it

Santhosh PS said...

preety simple and neat

Anonymous said...

the Demo is not working !!

Anonymous said...

Your demo isn't loading images at all

http://demos.9lessons.info/CssDesign.html

Please fix it

Srinivas Tamada said...

Now demo available

Anonymous said...

only one word for u you are great u r web site very useful lot of useful information on u r web site thank you very very very much
:Rahul Khakse

leslie said...

this is great mate, can u heat us we the facebook massages system

Anonymous said...

Cool

Post a Comment

Subscribe now!Recent Posts

Categories

Subscribe now!Popular Posts

People Says

@9lessons thank you for the great tutorials, we truly appreciate your contributions to the design community.

Smashing Magazine
After developing a site you’ll require a web hosting plan to host your site, a recommended host is justhost.com which operates a LAMP environment and has been established a number of years.

Like Me