【发布时间】:2020-01-02 04:46:30
【问题描述】:
我正在创建一个联赛表,我想在每个结果的左侧和右侧包含每个团队的徽标(示例如下)。
我一直在尝试使用 float:right 和 left,但它没有按预期工作。
HTML:
<table border=2>
<tr>
<th>Local Team</th>
<th>Result</th>
<th>Away Team</th>
</tr>
<tr>
<td>Team 1</td>
<td><img class="photoL" src="https://cdn0.iconfinder.com/data/icons/cup/154/football-shield-club-sport-512.png" alt="" /><div class="result">0 - 0 </div><img class="photoR" src="https://cdn0.iconfinder.com/data/icons/cup/154/football-shield-club-sport-512.png" alt="" /></td>
<td>Team 2</td>
</tr>
</table>
CSS:
.photoL {
max-width: 66px;
height: 40px;
float: left;
margin: 0px 0px 5px 0px !important;
}
.photoR {
max-width: 66px;
height: 40px;
float: right;
margin: 0px 0px 5px 0px !important;
}
.result {
}
我正在寻找的结果是:[IMG1] 0 - 0 [IMG2] 都在 td 内的同一行中。
【问题讨论】:
标签: html css image html-table