twitter-bootstrap 相关问题

Bootstrap是一个前端框架,旨在启动Web应用程序和站点的开发。有关Bootstrap版本的问题,请使用“twitter-bootstrap-2”,“twitter-bootstrap-3”和“bootstrap-4”标签中的特定版本标签。

部署到Heroku后缺少bootstrap样式

基于我过去两天一直在做的谷歌搜索,我加入了数百(如果不是数千)在部署到Heroku时失去引导样式的人。和其他人一样,......

回答 3 投票 2

在启动时隐藏引导表中的列

我有下表,我使用Bootstrap-table

回答 4 投票 7

Bootstrap轮播在移动设备上更改配置

我试图制作一个带有bootstrap 4但没有成功的下一个/上一张幻灯片的部分预览的旋转木马..现在版本3.3.7我得到了它。但现在我有新问题,我想要幻灯片......

回答 1 投票 1

Bootstrap导航栏下拉菜单和汉堡无法正常工作

我正在使用boostrap创建一个导航栏,下拉菜单,汉堡等不起作用。我的意思是他们点击时不会扩展。我曾经使用过Bootstrap,但没有遇到过这个......

回答 1 投票 2

Bootstrap 4 Typeahead

我正在使用jQuery Bootstrap Typeahead。我从我的文件中获取数据但是没有填充/显示typeahead下拉列表。这是我的JS :( function(){“use strict”; var $ input = $('。typeahead'); $('....

回答 1 投票 5

align-items-center,同时保持背景全高

我在Bootstrap 4中的一行中有两列。如果我尝试使用行上的align-items-center垂直对齐内容,或者在col上对齐 - 自我居中,则h4居中但背景是......

回答 1 投票 0

使用带有固定位置标题的 scrollIntoView

我有一个标题设置为 position: fixed 的站点。在我的一个页面上,我在一个元素上使用了 scrollIntoView(true) 。我的问题是,当调用 scrollIntoView 时,元素被定位在...

回答 11 投票 0

$(...)。datepicker不是函数--JQuery - Bootstrap

我正在尝试为引导程序包含datepicker但是我收到以下错误:未捕获的TypeError:$(...)。datepicker不是一个函数我不明白为什么它在那里。我看过其他案例......

回答 8 投票 7

隐藏的弹出事件不能在bootstrap模式上工作

我试图在bootstrap关闭时触发回调函数。但它没有用。我用过的代码:

回答 1 投票 0

bootstrap断点...需要一些澄清'xs sm md lg'

所以..在网上看,我看到一些最近的文章说明xs断点是480px及以下..其他..状态767及以下..我有理解(可能不正确)xs是...

回答 1 投票 22

在codeigniter上输入html,

我有使用bootstrap的HTML,它是这样编写的: PIB Ajuan ...

回答 2 投票 1

如何使用Twitter Bootstrap隐藏元素并使用jQuery显示它?

假设我创建了一个这样的HTML元素, Hello, TB3 Hello, TB4

回答 19 投票 206

导航栏改变颜色javascript无法正常工作

和其他人一样,我在向下滚动时尝试修改导航栏。我读到了这个问题:滚动后更改导航栏颜色? Scroll Down Bootstrap导航栏将颜色更改为...时Navbar中的过渡

回答 2 投票 0

在bootstrap模式中显示视频js视频的问题

模态显示正确,但当我点击模态。视频和视频控制混乱了。如果我做错了,请建议是否有任何其他合适的方式。我有一个很好的图书馆......

回答 1 投票 0

Bootstrap DateRangePicker日历和右/左图标不显示

我正在使用Bootstrap Date Range Picker,在此我无法获得Calendar和Left / Right Arrow glyphicon。下面是我实施的代码。

回答 2 投票 0

Bootstrap元素100%宽度

我想创建交替的100%彩色块。 “理想”情况被说明为附件以及当前情况。期望的设置:目前:我的第一个想法是创建一个......

回答 11 投票 68

form-inline类的bootstrap 4在IE和Edge中显示两行控件

我使用bootstrap 4在html中使用了以下标记,它在单行中显示,而在IE Edge中它被分成两个

回答 1 投票 -1

select2 MULTIPLE 占位符不起作用

我正在使用以下代码来选择项目,但占位符已经不可见。我正在使用这个例子 select2-bootstrap 我正在使用以下代码来选择项目,但占位符已经不可见。我正在使用这个例子select2-bootstrap <div class="form-group" style="width:70px; height:44px;"> <select class="form-control select2" multiple="multiple" id="select2" placeholder="cawky parky"> <option>ahoj</option> <option>more</option> <option>ideme</option> <option>na </option> <option>pivo?</option> </select> </div> <script src="//select2.github.io/select2/select2-3.4.2/select2.js"></script> $(document).ready(function () { $("#select2").select2({ multiple:true, placeholder: "haha", }); 2020解决方案 这里的大问题是您选择的第一个选项 + 您的占位符太大而无法放入下拉列表中。因此,select2 将强制占位符为 width:0;. 这可以通过以下两行 CSS 来解决,这将覆盖此 select2“功能”: .select2-search--inline { display: contents; /*this will make the container disappear, making the child the one who sets the width of the element*/ } .select2-search__field:placeholder-shown { width: 100% !important; /*makes the placeholder to be 100% of the width while there are no options selected*/ } 注意:placeholder-shown 伪类在某些浏览器的最旧版本以及 IE 上不起作用,因为您可以在here. 经过数小时的尝试,我注意到最初呈现选择时,.select2-search__field 的宽度为 0px。当我选择一个选项然后删除该选项时,显示占位符并且宽度约为 1000px。 所以为了解决这个问题,我做了以下事情: $('.search-select-multiple').select2({ dropdownAutoWidth: true, multiple: true, width: '100%', height: '30px', placeholder: "Select", allowClear: true }); $('.select2-search__field').css('width', '100%'); 在您的脚本文件中添加: $('select').select2({ minimumResultsForSearch: -1, placeholder: function(){ $(this).data('placeholder'); } }): 在 HTML 中添加: <select data-placeholder="Yours Placeholder" multiple> <option>Value 1</option> <option>Value 2</option> <option>Value 3</option> <option>Value 4</option> <option>Value 5</option> </select> 只需使用数据占位符而不是占位符。 <div class="form-group" style="width:70px; height:44px;"> <select class="form-control select2" multiple="multiple" id="select2" data-placeholder="cawky parky"> <option>ahoj</option> <option>more</option> <option>ideme</option> <option>na </option> <option>pivo?</option> </select> </div> 对我来说,占位符似乎需要allowClear: true和对象模式。尝试以下操作,看看它是否有效。有关使用 yadcf 的一般示例,请参见https://codepen.io/louking/pen/BGMvRP?#(抱歉,额外的复杂性,但我相信 yadcf 将 select_type_options 直接传递给 select2)。 $("#select2").select2({ multiple:true, allowClear:true, placeholder: { id: -1 text: "haha" } }); 在你的脚本文件中: $("select").each(function(i,v){ var that = $(this); var placeholder = $(that).attr("data-placeholder"); $(that).select2({ placeholder:placeholder }); }); 在您的 html 中(添加数据占位符 =“您的文本”): <select data-placeholder="Yours Placeholder" multiple> <option>Value A</option> <option>Value B</option> </select> 这是 select2 GitHub 上的 已解决问题 但它从未在库本身中真正解决过。 我的解决方案类似于 Pedro Figueiredo 提出的 solution,除了它不会使容器消失。有一个关于display: contents的note,这可能会导致一些可访问性问题。您也可以简单地将其切换为 100% 宽度: .select2-search--inline, .select2-search__field:placeholder-shown { width: 100% !important; } 我更喜欢并发现基于 .select2-container 设置样式稍微更简洁,这样我就可以调用标准的 HTML 元素,如下所示: .select2-container li:only-child, .select2-container input:placeholder-shown { width: 100% !important; } 任何一组代码都以任何一种方式访问相同的元素,我不确定哪一个更“未来证明”;现在这是一个偏好问题。 此外,如果您使用的是标签,则可能需要添加一个 .select2-container { width: 100% !important; } 否则在切换到默认情况下不显示的选项卡时,select2 字段的宽度可能不正确。 在你的 html 中 <select class="form-control select2" multiple="multiple" id="select2"> <option selected="selected">cawky parky</option> <option>ahoj</option> <option>more</option> <option>ideme</option> <option>na </option> <option>pivo?</option> </select> 在你的 jquery 中 $(".select2").select2({ placeholder: "Selecione", allowClear: true }); 我找到了另一种方法,当我将 select2 附加到 dom 时 $('.select2-search__field').width('100%') 用它改变宽度样式 $('.select2-search__field').width('100%') function setSelect(select, data, placeholder) { select.each(function () { let $this = $(this) $this.wrap('<div class="position-relative"></div>') $this.select2({ placeholder, allowClear: true, dropdownParent: $this.parent(), dropdownAutoWidth: true, data }) }) $('.select2-search__field').width('100%') } 选择2/3.5.4 在你的 CSS 中: .select2-search-field, .select2-search-field input[placeholder] { width: 100% !important; } Select2 4.0.1 仍然不适用于我的多项选择。 我的解决方案 HTML <select class="select-2" multiple> ... </select> JS $('.select-2').select2({ minimumResultsForSearch: -1, placeholder: function(){ $(this).data('placeholder'); } }); $('.select-2[multiple]').each(function() { $(this).next('.select2').find('textarea').attr('placeholder', $(this).data('placeholder')); }); $('.select2-search__field').css('width', '100%'); 试试这个代码 在你的javascript中 $('.select2-search__field').addClass('w-100') 或 $('.select2-search__field').css('width', '100%') 占位符标签不是选择列表的有效属性 你可以使用这样的东西: <select class="form-control select2" multiple="multiple" id="select2"> <option selected="selected">cawky parky</option> <option>ahoj</option> <option>more</option> <option>ideme</option> <option>na </option> <option>pivo?</option> </select> 然后编写适当的 jquery 在你的select2-Bootstrap例子中是完全不同的结构 我在引导选项卡中有一些 select2 输入。 对我有用的解决方案: .select2-search--inline { display: contents; /*this will make the container disappear, making the child the one who sets the width of the element*/ } .select2-search__field:placeholder-shown { width: 100% !important; /*makes the placeholder to be 100% of the width while there are no options selected*/ }

回答 14 投票 0

是否建议使用简单的CSS类,如.text-center? [关闭]

我正在学习HTML / CSS,我看过一些例子,比如使用.text-center for text-align:center; (在Bootstrap3中)。这对我来说有点奇怪,因为这些类的css样式永远不会......

回答 1 投票 -1

如何在html选择中使用Bootstrap 3 glyphicon

我需要让用户在我的ui中选择Bootstrap 3 glyphicons的子集。我试过这个:

回答 4 投票 18

© www.soinside.com 2019 - 2024. All rights reserved.