图像没有出现在HTML中但是Inspector?

时间:2016-07-14 05:03:31

标签: html css image css3

我有以下代码,您也可以在附带的屏幕截图中看到:

echo '<ul class="floatleft">';
for($i=0;$i<count($items);$i++){
  if($i%4==0)
    echo '</ul><ul class="floatleft">';
  echo "<li>".$items[$i]."</li>";
}
echo '</ul>';

CSS

<img class="deliveryIcon delivered"/>

图像不会出现在呈现的HTML上。

我怀疑路径不正确,但图像在Inspector上正确显示。

有谁能告诉我出了什么问题?

enter image description here

2 个答案:

答案 0 :(得分:3)

试试这个。希望这会起作用

<img class="deliveryIcon delivered"/>
<style>
    .delivered {
        min-height:200px;
        min-width:200px;
     background-image: url("../images/icons/ic_done_all_white_48dp_2x.png");
     background-repeat: no-repeat;
}
</style>

答案 1 :(得分:0)

设置图像高度

.delivered {
    background: url("../images/icons/ic_done_all_white_48dp_2x.png") no-repeat;
height: 96px;
display: block;
}
相关问题