Sunday, October 4, 2009

HOW TO: Elegant CSS Message Boxes for Blogs

CSS Message Boxes for Premium Style Blogger Templates

Wait are you and Wordpress user? Dont think this can be used only on Blogger. Css is common to all so read on. Want to display an error message, or an alert, or simply a notification in your blogger template? No you dont have to create a photoshopped image and add the image in your posts all the time. Let me tell you how some simple CSS can be used to do that trick.

CSS Message Boxes for Premium Style Blogger Templates




CSS Message Boxes for Premium Style Blogger Templates

/*message box chethstudios */
.fave_css, .home_css, .idea_css, .author_css, .rss_css, .pen_css, .tooledit_css, .alert_css, .comment_css, .lock_css, .book_css {
border: 1px solid
margin: 10px 0px;
padding:15px 10px 15px 50px;
background-repeat: no-repeat;
background-position: 10px center;
}
.fave_css {
color: #00529B;
background-color: #BDE5F8; -moz-border-radius-topleft: 18px; -moz-border-radius-topright: 18px; -moz-border-radius-bottomright: 18px; -moz-border-radius-bottomleft: 18px;
background-image: url('https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEifOFTAfRfyb8Xyxhw7fv6C89B4hzv4HvnaoIrEA4LfCDnTTjq7JqX_D1Vo_Ebfadf0fH40aF7gFZLXPJFFA-QiW66XnkPKMHW-oVF31BeID0Nq5PQjiMWZV-h_JJmMy7BS2F6ZzfsUhqQ/');

}
.home_css {
color: #4F8A10;
background-color: #DFF2BF; -moz-border-radius-topleft: 18px; -moz-border-radius-topright: 18px; -moz-border-radius-bottomright: 18px; -moz-border-radius-bottomleft: 18px;
background-image:url('https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhwTH5ZroYA36VTfj-_YcVkhdLr1UQirfYCwNyP61zJyQx-Oh7B8amS165o_o4-cHGcSk7tuAkYJiPqYFwI5prGWDCh5SnOs9D64FWnudhZnV8nTWQI_Fg3kbTIYw6bT8m_5CQMmXuh9w0/');
}
.idea_css {
color: #9F6000;
background-color: #FEEFB3; -moz-border-radius-topleft: 18px; -moz-border-radius-topright: 18px; -moz-border-radius-bottomright: 18px; -moz-border-radius-bottomleft: 18px;
background-image: url('https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiX_uM8Q7mvzURqnPenaKO9bDnYLJd9AZ1XNLzj_JDphklIax1uhulcwfmWsi4NH2BWECdyEiQVLq80D4f_vPsWfp9dD5cSYx65zPZpNb7mKpEHxgkO0XYn-k2jr2PKviurypAPXWLUAuI/');
}
.author_css {
color: #2E2D2D;
background-color: #A1C2C7; -moz-border-radius-topleft: 18px; -moz-border-radius-topright: 18px; -moz-border-radius-bottomright: 18px; -moz-border-radius-bottomleft: 18px;
background-image: url('https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiUO0GjEoCqbUzS4AnuwS18JtclwHEwdDkr8Menre9NZxEhdj2yKnMYb84kO-E6eF3_jm2yVYuf1JmyarbynJ2xnKfkX_RDNZ5oETXqerKSlKKG2x9NlA0RDQwfXqnG7ly-3Ba2bt9kgzc/');
}
.rss_css {
color: #4F8A10;
background-color: #DFF2BF; -moz-border-radius-topleft: 18px; -moz-border-radius-topright: 18px; -moz-border-radius-bottomright: 18px; -moz-border-radius-bottomleft: 18px;
background-image:url('https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhGULDMQkNion_NjtsPRfZU0v9INEBW4lZ_cVqxkP3OKW4qFfz1GOW9K_D-fpZxn3DDrDWvGgECLe-wEnsvrqj2jDju2SJqg9day1-zdSSH6Ifs6hBr2ZFshmmXOYruSzX6zA3ahe_YHmk/');
}
.pen_css {
color: #2E2D2D;
background-color: #C8E0C8; -moz-border-radius-topleft: 18px; -moz-border-radius-topright: 18px; -moz-border-radius-bottomright: 18px; -moz-border-radius-bottomleft: 18px;
background-image: url('https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgQdClNdx72JAbP_MOQh8VCq7GP36G_lBfbkbVMqcbzjeKXoZ5bUbzO93KBO5ANZhC0f5gLMg786Ad3iQZWbtjL33lvWLJesFuXDu6X2BCdYTzu0FIUCFwAuEvjDhVbojaeKJRET1430AU/');
}
.tooledit_css {
color: #554529;
background-color: #F1C983; -moz-border-radius-topleft: 18px; -moz-border-radius-topright: 18px; -moz-border-radius-bottomright: 18px; -moz-border-radius-bottomleft: 18px;
background-image: url('https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhf8PTpwYH_BwrAc1ibkoJ0AWVTe5yWyZI4LrUZnN7Gd0LILM57_kw0PxqTAjWdLT9pZeZnxS2TYO-05ATKB-5UEmMzAwOOga4rRsVJABQGVqm6E2zEgjHl90eqPMbUiAnYwcd_89gxCCE/');
}
.alert_css {
color: #2E2D2D;
background-color: #D25F66; -moz-border-radius-topleft: 18px; -moz-border-radius-topright: 18px; -moz-border-radius-bottomright: 18px; -moz-border-radius-bottomleft: 18px;
background-image: url('https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjFLZRyiB5yhyeOICW8le9tbE9z5cm4xIYtdJgXtvCJaZ9mkYh1l9QS4KVH470DirSu2SK-p1KeZbB7X2iB6vQC1tset0jeiH2Hkq5dODCHmzoan2wdvW8UejKgIgSE7oNmH3rKG7XYk98/');
}
.comment_css {
color: #2E2D2D;
background-color: #A6C8D2; -moz-border-radius-topleft: 18px; -moz-border-radius-topright: 18px; -moz-border-radius-bottomright: 18px; -moz-border-radius-bottomleft: 18px;
background-image: url('https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhwwpLafoP19RvgJ-Y8obmSVDV6cFyiWAJV7VYlk32K8CMhmd0vCdvQQ7NBO8xkL7fSaXEgID-tPAaP8YFfK2U7V8C99lu2ZSLpSfO5IJ-SwzfKWML6ahpyoslxUpuQHOs7LlrWHD68kKE/');
}
.lock_css {
color: #2E2D2D;
background-color: #FFBABA; -moz-border-radius-topleft: 18px; -moz-border-radius-topright: 18px; -moz-border-radius-bottomright: 18px; -moz-border-radius-bottomleft: 18px;
background-image: url('https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhzEZu1mMCWh-r00Dh1Os7B765oYdINZ5-KUFkQoT8FfXRolrLmzwBnvT6fkCMH_GMToG0eGuN3ypXne2WtT7EIuKTYyNfzeadGLPHApNLrI8xoAsldkzp7nev3XKVM-qr1g2Z_9ksKVHU/');
}
.book_css {
color: #4F8A10;
background-color: #DFF2BF; -moz-border-radius-topleft: 18px; -moz-border-radius-topright: 18px; -moz-border-radius-bottomright: 18px; -moz-border-radius-bottomleft: 18px;
background-image:url('https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgtimvguCaXwwpznbfJGb_I9ze_G0FG0Trc9VVswadjU8ogfOwdY9-iNHXVgId4tq2XD_jK4n8py7c0fXnpXWDI6zgFoIsZgYBcAYCWLyQmWc3YssZ1zrek6TkMSWBjpQy7nT8lS4s2iEE/');
}
/*message box end*/


And Whenever You make use of this message box. type your message within the div code. And you will have a beautiful message box customised with your own icon.

<div class="fave_css ">
This is a neat box to show some text with a heart message icon.
</div>

<div class="home_css ">
This is a neat box to show some text with a home message icon.
</div>

<div class="idea_css ">
This is a neat box to show some text with a idea message icon.
</div>

<div class="author_css ">
This is a neat box to show some text with a author message icon.
</div>

<div class="rss_css ">
This is a neat box to show some text with a rss message icon.
</div>

<div class="pen_css ">
This is a neat box to show some text with a pen/pencil message icon.
</div>

<div class="tooledit_css ">
This is a neat box to show some text with a edit message icon.
</div>

<div class="alert_css ">
This is a neat box to show some text with a alert/caution message icon.
</div>

<div class="comment_css ">
This is a neat box to show some text with a comment message icon.
</div>

<div class="lock_css ">
This is a neat box to show some text with a lock message icon.
</div>

<div class="book_css ">
This is a neat box to show some text with a book message icon.
</div>

You can also get a free subscription to Chethstudios updates. We will be back with more useful content. Get latest hacks and updates on your email
Download the testking 642-515 tutorials and testking 650-393 demos to learn about CSS and wordpress. Join testking RH202 online course to learn about more useful contents.

23 comments:

  1. A nice tutorial Cheth!! :) I love those icons.. they look very cute!!! :)

    ReplyDelete
  2. This is very cool :-)

    ReplyDelete
  3. Thanks Cheth. Very good tutorial :)

    ReplyDelete
  4. There is an error in your css, a semicolon was missing after the border style in your first rule.

    I have it in my head that being less explicit about generic message box declaration would make life easier in the future should you want to add new types of message boxes.

    For example this:
    .fave_css, .home_css, .idea_css, .author_css, .rss_css, .pen_css, .tooledit_css, .alert_css, .comment_css, .lock_css, .book_css {
    border: 1px solid;
    margin: 10px 0px;
    padding:15px 10px 15px 50px;
    background-repeat: no-repeat;
    background-position: 10px center;
    }

    would turn into:
    .message_box {
    background-position: 10px center;
    background-repeat: no-repeat;
    border: 1px solid;
    margin: 10px 0px;
    padding:15px 10px 15px 50px;
    }

    and in the html, this:
    <div class="fave_css ">
    This is a neat box to show some text with a heart message icon.
    </div>

    would turn into:
    <div class="fave_css message_box">
    This is a neat box to show some text with a heart message icon.
    </div>

    ReplyDelete
  5. Lovely boxes, bookmarked!

    Thanks for your efforts :)

    ReplyDelete
  6. unless im missing something, they can all be -moz-border-radius: 18px
    and by that point you might as well add -webkit-border-radius: 18px

    ReplyDelete
  7. A very nice tutorial. Thanks for your efforts.

    ReplyDelete
  8. Interesting idea. I'd recommend consolidating and cross-browsering the rounded corner CSS. Maybe make a default class for all of them.

    Good work!

    ReplyDelete
  9. Ou its beautifull blog! Really. Plz http://freemusicvk.blogspot.com/ .. its my first blog please look at it.

    ReplyDelete
  10. Yes, you should really change all those 4 styles with just "-moz-border-radius: 18px" and also, if you want to enable this in google chrome and safari, add "-webkit-border-radius: 18px" too.

    ReplyDelete
  11. WoW :) Awesome tutorial post. Nice css explanation for message boxes. Thanks for sharing this nice post.

    ReplyDelete
  12. css message box is useful to my friend website.
    http://www.areapal.com/rapo

    ReplyDelete
  13. Great post....
    this tutorial will be beneficial to everyone...keep posting

    ReplyDelete
  14. Why are they not rounded ! WTF ?

    ReplyDelete
  15. I don't know if they aren't rounded but there is a little error in css (example: background-image:url('http://3.bp.blogspot.com/_5rlxf3T9Z9U/SsIX0rlYZ9I/AAAAAAAADcY/YE6Y2Nev0to/rss_32.png'); ) Instead of ' and ' you have tu place this: '
    and after the image line you have to place:
    background-repeat:no-repeat;
    if you don't want the image to be repeated in each line.

    If someone knows of to make them rounded I'm here ready to listen :-)

    ReplyDelete
  16. Found the way to have them rounded...instead of every:
    -moz-border-radius-topleft: 18px; -moz-border-radius-topright: 18px; -moz-border-radius-bottomright: 18px; -moz-border-radius-bottomleft: 18px;

    place:

    -webkit-border-radius: 18px

    It will be enough and it works in Blogger XD

    ReplyDelete
  17. Hi,

    Presentation of CSS Message Boxes for Premium Style Blogger Templates is good.

    Dayanand from Website Developmen Co.

    ReplyDelete
  18. For all that ask where's the round box, well first of all round corners don't work with IE, only Chrome, Firefox, Safari and Opera. New IE9 Beta does have border radius.

    To include all* browsers and IE9 you should use:

    -moz-border-radius: 18px;
    -khtml-border-radius: 18px;
    -webkit-border-radius: 18px;
    border-radius: 18px;

    Once again pre IE9 doesn't have border radius support.

    Good Job mate

    ReplyDelete
  19. Let me know some simple CSS can be used to create some images in blog?

    ReplyDelete
  20. great link… i found some perfect results for me here… thanks a lot to share!

    ReplyDelete

Please Don't Spam that's all. Grab our RSS Feed and we would Love to see you in our comments section more often.