display icon to left of text
In our html we have:
<div id="error2"></div>
This displays dynamic error message.
In the css I have:
#error2 {
background:url(../images/cross.png) left center no-repeat;
color: #ff2217;
font-size:16px;
font-weight:bold;
position:absolute;
top:175px;
left:32px;
}
What I get is:
What I want is:
开发者_运维问答Try adding some padding:
#error2 {
padding-left: 30px;
}
Use padding-left:;
like this: http://jsfiddle.net/8DnTa/
精彩评论