如果里面没有内容,div.deletePhone
那么你需要指定高度,否则它将是0px
.
#div1 ul li .deletePhone{
background-image: url(http://localhost/TheEatTel/public/images/close.png);
background-repeat: no-repeat;
height:100px; /*some height value*/
}
那或var phone
放入div.deletePhone
:
$("#div1 ul").append("<li><div class='deletePhone'>"+phone+"</div></li>");