【发布时间】:2021-03-24 18:00:35
【问题描述】:
我已经为父 div 使用了容器类
这里:
<div class="container">
<main role="main" class="pb-3">
<div style="width:100%; height:300px;z-index:-1" class="col-lg-12 mt-n4 bg-white text-
center">
<div style="margin: 0;position: absolute;top: 50%;left: 50%;-ms-transform:
translate(-50%,
-50%);transform: translate(-50%, -50%);">
<img class="rounded-circle border border-info p-1" style="width:150px;height:150px;"
src="~/ProfileImages/@currentuser.ImageProfile">
<h4 class="text-center font-weight-bold text-info">@Model.ApplicationUser.ArName</h4>
</div>
</div>
</main>
</div>
现在:我想将父级内 div 的宽度设为 100%,但我无法使用此代码:
<div style="width:100%; height:300px;z-index:-1" class="col-lg-12 mt-n4 bg-white text-center">
<div style="margin: 0;position: absolute;top: 50%;left: 50%;-ms-transform: translate(-50%,
-50%);transform: translate(-50%, -50%);">
<img class="rounded-circle border border-info p-1" style="width:150px;height:150px;"
src="~/ProfileImages/@currentuser.ImageProfile">
<h4 class="text-center font-weight-bold text-info">@Model.ApplicationUser.ArName</h4>
</div>
</div>
如何删除子元素上的引导“容器”类效果?
【问题讨论】:
标签: css twitter-bootstrap bootstrap-4