【发布时间】:2014-06-10 05:39:23
【问题描述】:
我有以下 HTML 标记,用于显示产品类别列表
HTML:
<ul data-bind="foreach: Combos" style="margin: 0; padding: 0; color: White;">
<li id="comboItem" style="list-style-type: none;">
<table style="width: 100%; height: 100%; margin-bottom: 10px;" data-bind="click: $root.selectCombo">
<tr>
<td style="height: 30px; background-color: #0089d1;">
<table style="width: 100%;">
<tr>
<td style="height: 25px; padding-left: 10px; font-weight: bold; background-color: black;
color: #0089d1; margin: 1px; width: 70%;">
<span data-bind="text: Description" />
</td>
<td style="color: Black; width: 30%; text-align: center;">
<span data-bind="text: formatCurrency(Price)" style="font-size: 13px; white-space: nowrap;
font-weight: bold;" />
</td>
</tr>
</table>
</td>
</tr>
</table>
</li>
</ul>
创建以下输出:
现在我需要添加一个与包含产品描述的 td 元素略微重叠的图像,以创建以下效果:
我非常感谢有关如何做到这一点的任何提示
【问题讨论】:
-
我个人会避免使用表格。坚持使用
li,将图像作为li的背景,使用div或span作为其他元素。
标签: css html asp.net-mvc-4 c#-4.0