为什么不在一行中不显示div元素?

发布于 2025-02-10 23:36:31 字数 830 浏览 1 评论 0原文

我如何

在网站中尝试过的解决方案中的一行中显示DIV元素,但仍无法使用,

这是视图代码:

<div class="row">
@foreach (var item in Model)
{
    <div class="col-md-4 thumbnail" style="margin-left:30px;margin-bottom:30px; height:100px;border:solid;float:left;width:350px;">
            <h3>@Html.DisplayFor(modelItem => item.id)</h3>
            <h3>@Html.DisplayFor(modelItem => item.name)</h3>
            @Html.ActionLink(" Show Result ", " Results ", new { sId = Model.FirstOrDefault().id }, new { @class = "btn btn-primary" });
        
    </div>
}
</div>

请参阅图像视图,我需要输出在框

1示例中的一行中,no 1显示结果

How can I show the div elements in one line

I tried solutions in the site but still not working

This is the view code :

<div class="row">
@foreach (var item in Model)
{
    <div class="col-md-4 thumbnail" style="margin-left:30px;margin-bottom:30px; height:100px;border:solid;float:left;width:350px;">
            <h3>@Html.DisplayFor(modelItem => item.id)</h3>
            <h3>@Html.DisplayFor(modelItem => item.name)</h3>
            @Html.ActionLink(" Show Result ", " Results ", new { sId = Model.FirstOrDefault().id }, new { @class = "btn btn-primary" });
        
    </div>
}
</div>

See the image view I need the output to be in one line inside the box

1 Sample No 1 Show Result

enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

我做我的改变 2025-02-17 23:36:31
@foreach (var item in Model)
{
    <div class="col-md-4 thumbnail" style="margin-left:30px;margin-bottom:30px; height:100px;border:solid;float:left;width:350px;">
        <h3>@Html.DisplayFor(modelItem => item.id)  @Html.DisplayFor(modelItem => item.name)</h3>
            @Html.ActionLink("Show Result", "Results", new { sId = Model.FirstOrDefault().id }, new { @class "btn btn-primary" });
    </div>
}

或将H3转向H4

@foreach (var item in Model)
{
    <div class="col-md-4 thumbnail" style="margin-left:30px;margin-bottom:30px; height:100px;border:solid;float:left;width:350px;">
        <h3>@Html.DisplayFor(modelItem => item.id)  @Html.DisplayFor(modelItem => item.name)</h3>
            @Html.ActionLink("Show Result", "Results", new { sId = Model.FirstOrDefault().id }, new { @class "btn btn-primary" });
    </div>
}

or change H3 heading to H4

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文