- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我正在创建我的网站的一部分,其中包括一个 Jumbotron 和一个可折叠的警报消息,它们都来自 Bootstrap 框架。我对警告框的边距有疑问。我为 Jumbotron 使用标准 CSS 并调整了填充,但这不会影响我的问题。
我希望警告框与选择框对齐。我尝试用这个覆盖警报类的属性:
.alert-custom-style {
margin-left: 15px;
margin-right: 15px;
width: 100%;
}
这对左侧确实有效,但不知何故没有考虑 margin-right 属性。我通过将 margin-left 放回 0px 来测试它,但它看起来就像第一张图片。我真的很想知道为什么左边距属性有效,而不是右边距属性。非常感谢任何建议或帮助。
这是 HTML 代码:
<div class="jumbotron jumbotron-custom">
<div class="row">
<div class="col-lg-5 col-md-5 col-sm-12 col-xs-12 top-buffer">
<!-- Dropdown List for the first country -->
<select id="country1" name="Country Selection 1" class="selectpicker" data-width="100%" data-style="btn-default" data-live-search="true" title="Choose..."></select>
</div>
<div class="col-lg-2 col-md-2 col-sm-12 col-xs-12 top-buffer">
<!-- Compare Button -->
<button id="btnSubmit" type="Submit" class="btn btn-success btn-block">Compare</button>
</div>
<div class="col-lg-5 col-md-5 col-sm-12 col-xs-12 top-buffer">
<!-- Dropdown List for the second country -->
<select id="country2" name="Country Selection 2" class="selectpicker" data-width="100%" data-style="btn-default" data-live-search="true" title="Choose..."></select>
</div>
<!-- JavaScript file to handle the data management -->
<script src="js/compare.js"></script>
<!-- JavaScript file to handle the selection lists -->
<script src="js/lists.js"></script>
</div>
<div class="row top-buffer">
<div id="alert" class="collapse alert alert-custom-style col-lg-12 col-md-12 col-sm-12 col-xs-12" role="alert"> <!-- Collapsed by default -->
<strong>Warning: </strong><span id="alert-span">Please select at least two different countries</span>
</div>
</div>
</div>
最佳答案
对于包含 top-buffer
类警报的行,尝试添加:
margin-left: 15px;
margin-right: 15px;
我没有你所有的 css,但这里有一个粗略的版本,我认为它近似于你想要的。
使用代码段底部的“整页”按钮以更宽的 View 查看结果。
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" />
<div class="container">
<div class="jumbotron">
<div class="col-lg-5 col-md-5 col-sm-12 col-xs-12 top-buffer">
<!-- Dropdown List for the first country -->
<select id="country1" name="Country Selection 1" class="selectpicker" style="width:100%;" data-width="100%" data-style="btn-default" data-live-search="true" title="Choose...">
</select>
</div>
<div class="col-lg-2 col-md-2 col-sm-12 col-xs-12 top-buffer">
<!-- Compare Button -->
<button id="btnSubmit" type="Submit" class="btn btn-success btn-block" style="width:100%;">
Compare
</button>
</div>
<div class="col-lg-5 col-md-5 col-sm-12 col-xs-12 top-buffer">
<!-- Dropdown List for the second country -->
<select id="country2" name="Country Selection 2" class="selectpicker" style="width:100%;" data-width="100%" data-style="btn-default" data-live-search="true" title="Choose...">
</select>
</div>
<div class="row top-buffer" style="margin-left: 15px; margin-right: 15px;">
<div id="alert" class="collapse in alert alert-custom-style col-lg-12 col-md-12 col-sm-12 col-xs-12" role="alert" style="background-color: red;"> <!-- Collapsed by default -->
<strong>Warning: </strong><span id="alert-span">Please select at least two different countries</span>
</div>
</div>
</div>
</div>
关于html - Jumbotron 错误边距中的 Bootstrap 警报,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43123602/
我正在学习网页设计和 js。在我的网页上,我将 jumbotron h2 中的默认颜色定义为黑色。 .jumbotron h2{ text-align: center; color:b
尝试更改我的 jumbotron 的背景和颜色,但没有任何反应。padding有效,但 background没有。 我的 CSS: .jumbotron { padding:70px 30px
我无法弄清楚为什么我的超大屏幕容器会覆盖整个页面。我正试图让超大屏幕在“找到你的大学”之前停下来。 其次,我也无法将搜索栏移动到超大屏幕的中间。谁能帮忙?我是 HTML、CSS 和 Bootstrap
我正在尝试缩小社交图标之间的间隙/边距,并使其在文本下方居中。 Jumbotron 代码如下: div class="jumbotron"> A blog to explore, learn
这个问题在这里已经有了答案: Bootstrap Jumbotron not becoming full width of Body (7 个答案) How to make a full-widt
Bootstrap Jumbotrons 在我的网站上超出了容器,这意味着移动版本上的导航栏没有填满屏幕。我没有超大屏幕的其他页面不会出现此问题。 我尝试使用卡片代替,但是当我把它放在文本以外的任何东
我制作了这个登陆页面,效果很好。背景图片覆盖了页面,看起来很棒。我离开它,一天后回来,它看起来不一样了。我看不出它的原因。图像根本不会出现在标题的文本后面(检查图片)。
我想将超大屏幕设置为 0.5 不透明度。 En 1
我目前正在使用最新版本的 bootstrap 3.0.0 问题很简单。在 jumbotron 容器中,我使用如何将文本与 Logo 居中对齐 我已经玩了几个小时,使用 col-md-* 并且运气不佳。
我是网络开发的新手,在使用 bootstrap/CSS 时遇到了一些麻烦。我试图在默认 Bootstrap 超大屏幕后面有一个背景图像。最重要的是,我似乎也根本无法显示图像。我有点迷路了。任何帮助将不
我正在尝试将视频嵌入到引导超大屏幕中,但它并没有出现在我目前拥有的代码的任何地方。我错过了什么?
简单的 Bootstrap 超大屏幕... .jumbotron-page { height:300px; } 我需要在移动/小型设备上将高度更改为 100px,所以我明白了...... .jumbo
我正在使用 Bootstrap 为网站创建超大屏幕,但我遇到了超大屏幕无法在小屏幕上正确调整大小的问题。 这是我的代码 HTML
HTML: Toggle navigation
想问一下如何在不影响字体和按钮的不透明度的情况下,改变 Jumbotron 的不透明度使其全宽? .jumbotron-special{ text-align: center; bac
我有一个使用 Bootstrap 3 和 Jumbotron header 的 Wordpress 站点。我对使用 skrollr.js 的导航和背景有视差效果。 我为媒体查询 (768px) 设置了
我正在尝试获取以下代码来为超大屏幕背景加载随机图像,但没有成功。我只是不知道哪一部分是问题所在。超大屏幕本身充当基本 flex slider 的区域。我基本上希望 flex slider 的背景图像在
我在使用 BootStrap 时遇到了 Jumbotrons 的问题。我的页面上有 2 个 div,第二个应该占据剩余的屏幕尺寸。但是当我改变浏览器的高度和宽度时,它并没有相应地调整,因为 div 的
所以我不知道如何让这个 jumbotron div 具有指定的背景图像。以前我在另一个元素中使用它时它起作用了,但是当我将它导入另一个元素时它就停止显示了。其他一切正常,所以我虽然只是忘记了 css
似乎无法弄清楚如何在超大屏幕中使用 CSS 专门放置按钮。我使用了一些类,例如 text-left 或 pull-left,但它们并没有给我想要的外观。我想这是一些简单的 CSS,但我似乎无法理解。我
我是一名优秀的程序员,十分优秀!