【发布时间】:2020-01-17 06:15:50
【问题描述】:
我在使用 Bootstrap 时遇到了问题。 我想将图像居中,但使用以下代码,图像左对齐:
HTML:
<div className="App vh-100">
<div className="d-flex h-70 border border-white container">
<div class="py-5">
<div className="text-center">
<img src={logo} className="esc-logo slide-top center-block" alt="logo" />
</div>
</div>
</div>
<div class="container h-auto">
<h1>test</h1>
</div>
</div>
还有 CSS :
.App {
text-align: center;
background-color: #1e0933;
background-image: url(url);
background-attachment: fixed;
background-size: cover;
}
.esc-logo {
height: 40vmin;
}
怎么了?有人可以帮我吗?
感谢您的帮助, 拥抱0
【问题讨论】:
-
一切看起来都不错,请参阅 stackblitz:stackblitz.com/edit/react-chvfbq
标签: html css reactjs bootstrap-4