<分区>
如果 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>");