开发者

display icon to left of text

开发者 https://www.devze.com 2023-02-10 14:31 出处:网络
In our html we have: <div id=\"error2\"></div> This displays dynamic error message. In the css I have:

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:

display icon to left of text

What I want is:

开发者_运维问答

display icon to left of text


Try adding some padding:

#error2 {
padding-left: 30px;
}


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

0

精彩评论

暂无评论...
验证码 换一张
取 消