【发布时间】:2014-10-17 09:52:30
【问题描述】:
所以我正在显示列表中的项目,在 internet explorer 8 上它如下所示:
1 2 3
4 5 6
7 8 9
但在 Internet Explorer 9 上,它的布局不同,如下所示:
1
2
3
4
5
我注意到,当我删除字段集时,它可以解决问题,但我想要一种解决方法,而不必删除字段集。
查看
@foreach (var item in Model)
{
<fieldset style="width:399px; height:210px; border:1px; border-color:Black; background-color:White">
<tr>
<td> <div class="box"><a href=@Url.Action("Bid", "Items", new { id = item.ItemsID })>
<img alt ="@item.title" width="200px" height="200px" src="@Url.Content(@item.image1)" /></a></div>
</td>
<td><div class="box"><br /><br /> <b>Title : </b>@Html.ActionLink(@item.title, "Bid", "Items", new { id = item.ItemsID }, "")
<br /><b>Artist : </b>@item.artist<br />
<b>Condition : </b>@item.condition<br /><b>Current bid : </b>@if (item.currentBid == 0){ <font color="#E60000"><b>No bids</b></font> }else
{ <font color="#E60000"><b>£@item.currentBid</b></font> }<br /><p></p>
</div>
</td>
</tr>
</fieldset>
}
CSS
.box
{
padding: 15px 0px 0px 0px;
width:210px;
float: left;
height:150px;
}
【问题讨论】:
-
您的
fieldset宽度是 399 像素,您的.box是 210 像素。它不应该正确对齐。 -
我尝试将两者设置为相同的宽度,但问题仍然存在,还有其他建议吗?
-
你必须将
fieldset宽度设置为box* 3。 -
不幸的是,这只会使字段集变大,并没有解决问题
标签: html css razor model-view-controller