【发布时间】:2012-11-30 19:33:18
【问题描述】:
我在转发器 (ItemTemplate) 中有一个带有以下标记的 div
<div class="bottle listing">
现在由于某种原因被渲染为
<divclass="bottle listing">
这打破了页面。这只是很少发生,如果它只发生在某些浏览器中,我无法确定。请查看此网站:
http://www.myerwine.com.au/whites/chardonnay/4/16.aspx?page=2
我在 IE8 中查看它,但有人告诉我这个页面在 Firefox 和 Chrome 中有时会损坏。在 IE 中查看源代码时,请参阅第 415 行“divclass="bottle listing"
这是我的中继器的一部分:
<asp:Repeater ID="repResults" runat="server" OnItemDataBound="repResults_DataBound">
<ItemTemplate>
<div class="row listing">
<div class="bottle listing">
............
</div>
</div>
</ItemTemplate>
</asp:Repeater>
有什么想法吗??
【问题讨论】:
-
发布了正在输出的代码:
<div class="bottle listing">. -
我建议你在 html 验证器中破解你的代码。 validator.w3.org
-
我使用了一个验证器,它没有找到损坏的元素。然而 Firefox 正确地呈现了这个页面(对我来说)
-
我在 FF 中看到了问题。您需要从转发器的项目模板中发布代码。
-
只有转发器中的第一个 div 发生,其余重复的 div 发出正确的 html 是否重要。如果向该 div 添加两个空格或其他属性会发生什么?
标签: asp.net html css cross-browser