【问题标题】:Why Bootstrap panel is not working in Blazor client?为什么 Bootstrap 面板在 Blazor 客户端中不起作用?
【发布时间】:2020-03-30 08:24:09
【问题描述】:

我编译下面的代码以获得引导面板但没有成功

@page "/test"
<h3>test</h3>

<div class="panel panel-primary">
    <div class="panel-heading">Panel with panel-primary class</div>
    <div class="panel-body">Panel Content</div>
</div>

@code {

}

项目设置是

而 bootstrap.main.cs 是

wwwroot 文件夹如下所示

索引.html

【问题讨论】:

    标签: razor .net-core blazor


    【解决方案1】:

    在 Index.html 头部添加

    <link href="Bootstrap/bootstrap.mini.css" rel="stylesheet" />
    

    【讨论】:

      【解决方案2】:

      Blazor 使用 Bootstrap 4 和 .panel was replaced by .card

      所以基础版变成了这样:

      <div class="card text-primary">
          <div class="card-header">Panel with panel-primary class</div>
          <div class="card-body">Panel Content</div>
      </div>
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2014-01-10
        • 2021-01-08
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2018-03-10
        相关资源
        最近更新 更多