【发布时间】:2022-06-10 22:30:41
【问题描述】:
我有一个包含带有 li 元素的 html 的数据库字段,并且我正在使用 @Html.Raw 并且除 li 元素之外的所有内容都正确呈现。
这是来自我的 ASP.NET MVC 网站的代码。
<div class="col-xs-12">
@if (!String.IsNullOrEmpty(Model.ProductMetadataDTO.CoreProduct.MainDescription))
{
<h5><strong>Overview</strong></h5>
<span class="more">@Html.Raw(Model.ProductMetadataDTO.CoreProduct.MainDescription)/span>
}
@if (!String.IsNullOrEmpty(Model.ProductMetadataDTO.CoreProduct.ContributorBiography))
{
<h5><strong>Author Bio</strong></h5>
<span class="more">@Html.Raw(Model.ProductMetadataDTO.CoreProduct.ContributorBiography)</span>
}
</div>
我在 CoreProduct.MainDescription 所在的行上放了一个断点,然后将鼠标悬停在它上面并单击 HTML Visualizer,它看起来正确,项目符号点按预期呈现。
但这是我点击继续时浏览器中显示的内容。
我尝试了多个选项,但无法正确渲染。任何建议表示赞赏。
【问题讨论】:
-
看起来您可能有一个自定义样式,它以这种方式为您的列表元素设置样式。你检查过你的 CSS 吗?
标签: html asp.net-mvc