【发布时间】:2019-05-03 21:13:21
【问题描述】:
我正在尝试使用 bootstrap 4.1 来抵消我的列。我已经从here 复制了样本。我的页面有:
@page
@{
Layout = "./Shared/_NoLayout";
}
@model OVNew.Pages.TestModel
<h2>Test</h2>
<div class="container ">
<div class="row">
<div class="col-md-4 test-div">.col-md-4</div>
<div class="col-md-4 offset-md-4 test-div">.col-md-4 .offset-md-4</div>
</div>
<div class="row">
<div class="col-md-3 offset-md-3 test-div">.col-md-3 .offset-md-3</div>
<div class="col-md-3 offset-md-3 test-div">.col-md-3 .offset-md-3</div>
</div>
<div class="row">
<div class="col-md-6 offset-md-3 test-div">.col-md-6 .offset-md-3</div>
</div>
</div>
布局文件最小:
<!DOCTYPE html>
<html>
<head >
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
<link rel="stylesheet" href="~/css/site.css" />
<script src="~/lib/jquery/dist/jquery.min.js"></script>
</head>
<body>
<!--<partial name="_CookieConsentPartial" />-->
@RenderBody()
</body>
</html>
而 test-div 是这样定义的:
.test-div {
background-color: antiquewhite;
border: 1px solid;
margin: 5px;
}
我的页面如附件所示 - NO OFFSETS... 如果我删除封闭容器 div,情况类似。
发生了什么事?
我正在使用引导程序 4.1.3。我在测试版中看到了这个问题,但应该按照 4.1 文档进行修复。
【问题讨论】:
标签: razor bootstrap-4 offset