by Hamish Long
Here's a nice simple way of drawing attention to a message using CSS. It displays an icon, a coloured background and coloured borders with the message. Customise the code to fit your requirements. If you have any questions, please leave a comment.
Add this class to your stylesheet:
.attention
{
background: #C9E9F4 url(../images/snowflake.gif) center no-repeat;
background-position: 6px 50%;
text-align: left;
font-family: Arial;
font-size: 12px;
padding: 10px 10px 10px 40px;
border-top: 2px solid #0099CC;
border-bottom: 2px solid #0099CC;
}
On your webpage, put your message in a div tag with the “attention” class. For example:
<div class="attention">
Please take extra care when out and about at this time of the year as the pavements can be slippery due to ice. You should wear sensible shoes. Espadrilles are a no-no.
</div>
My example looks like this:
The icon image and text will stay vertically centred regardless of how much text your message contains.

by Katy Hillary



