【发布时间】:2021-06-16 18:41:14
【问题描述】:
我正在使用 Bootstrap 4.6 创建响应式页面 - 我在让行与行对齐时遇到问题。
我希望我的页面看起来像这样:
Topics | Gallery One Gallery Two Gallery Three
Most Popular Photos * Most Popular o Latest
但是,我有以下问题:
- 表单显示在同一行(视觉上),与包含“主题...”行的行
- 表单不在它自己的行内浮动
这是我的代码:
HTML
<div class="container">
<div class="row float-right">
<ul class="theme">Topics
<li>Gallery One</li>
<li>Gallery Two</li>
<li>Gallery Three</li>
</ul>
</div>
<div class="row">
<div>
<h2 class="font-weight-light text-center text-lg-left mt-4 mb-0">Most Popular Photos</h2>
</div>
<div>
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="inlineRadioOptions" id="inlineRadio1" value="option1">
<label class="form-check-label" for="inlineRadio1">Most Popular</label>
</div>
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="inlineRadioOptions" id="inlineRadio2" value="option2">
<label class="form-check-label" for="inlineRadio2">Latest</label>
</div>
<div class="form-check form-check-inline">
<button type="submit" class="btn btn-sm btn-success" id="submit" name="submit"/>Submit</button>
</div>
</div>
</div>
<hr class="mt-2 mb-5">
</div>
</div>
CSS
/* theme */
ul.theme {
padding: 5px 0px;
}
ul.theme li > a {
color: #CACACA;
text-decoration: none;
}
ul.theme li {
display: inline;
padding: 0px 4px;
}
ul.theme li a:hover {
color: #275d9c;
}
ul.theme li:first-child {
border-left: 1px solid #CACACA;
padding: 0px 4px;
}
ul.theme li.highlight {
border-bottom: solid 1px red;
}
如何解决这些问题?
【问题讨论】:
-
让这段代码在沙箱上可用....
标签: html css twitter-bootstrap bootstrap-4