【发布时间】:2018-06-23 10:17:42
【问题描述】:
我想将表单置于页面中心(例如在 Google 主页上),但这样做时遇到了问题。我正在使用 Bootswatch 主题 Darkly(从 CDN 托管)。
在 app.component.html 我有:
<div>
<div class="containercenter">
<form>
<fieldset>
<div class="form-group">
<label for="exampleInputEmail1">Email address</label>
<input type="email" class="form-control" id="exampleInputEmail1" aria-describedby="emailHelp" placeholder="Enter email">
</div>
<button type="submit" class="btn btn-primary">Submit</button>
</fieldset>
</form>
</div>
</div>
然后在 app.component.css 中:
#containercenter {
width: 100%;
height: 100%;
align-items: center;
}
我在 css 文件中尝试了各种方法,包括填充、高度、宽度、对齐内容……但这些似乎都不起作用。我也尝试过摆弄 HTML/Bootstrap id 或类,不同的 div。但没有任何效果。
如何为我的网页创建类似 Google 的布局??
欲了解更多信息,请参阅:https://github.com/gf1721/directoryapp
【问题讨论】:
-
现代 Web 开发非常困难
标签: javascript html css twitter-bootstrap layout