【发布时间】:2016-01-21 18:48:54
【问题描述】:
我的表格行中的图片有问题。由于某种原因,当我将图片浮动到左侧时,背景颜色不会扩展并填充表格行。
p.more {
color: rgb(255, 255, 255);
font-family: Arial;
font-size: 18px;
line-height: 140%;
margin: 0px;
text-align: center;
background-color: #cccccc;
}
img.more {
float: left !important;
margin: 0px 15px 15px 0px;
width: 330px;
}
span.more {
line-height: 100%;
text-align: center;
font-size: 18px;
}
span.moreweelove {
color: rgb(255, 255, 255);
}
<table>
<tr>
<td>
<p class="more">
<a href="http://blog.weespring.com/weelove-littlehipsqueaks-knotted-headbands/">
<img class="more" src="http://www.weespring.com/media/weelove_littlehipsqueeks.jpg">
</a>
<br>
<span class="more"><span class="moreweelove"><strong>Modern, Comfy, and Fun Staples</strong></span></span>
</p>
<p class="readmore">
<strong class="subheading">BIG LOVE FOR JUNE & JANUARY</strong>
<br>
<br>
<a href="http://blog.weespring.com/weelove-littlehipsqueaks-knotted-headbands/">
<img src="http://www.weespring.com/media/read-more.png">
</a>
<br>
<br>
</p>
</td>
</tr>
</table>
【问题讨论】:
-
您将颜色应用于单元格的内容,因此只有
<p>所在的位置才会有bg 颜色。您应该改为将颜色应用于包含<td>。 -
非常感谢大家。我对表格和编码很陌生,所以我很感激帮助!