422
422

Reputation: 5770

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:

enter image description here

What I want is:

enter image description here

Upvotes: 3

Views: 3796

Answers (2)

Marwelln
Marwelln

Reputation: 29433

Use padding-left:; like this: http://jsfiddle.net/8DnTa/

Upvotes: 0

Luke
Luke

Reputation: 1233

Try adding some padding:

#error2 {
padding-left: 30px;
}

Upvotes: 7

Related Questions