html下拉框按钮颜色,更改引导按钮和下拉切换的颜色(Changingcolorsonbo...

html下拉框按钮颜色,更改引导按钮和下拉切换的颜色(Changingcolorsonbo...

2023年7月9日发(作者:)

html下拉框按钮颜⾊,更改引导按钮和下拉切换的颜⾊(Changingcolorsonbo。。。更改引导按钮和下拉切换的颜⾊(Changing colors on bootstrap buttons and dropdown-toggle)我有⼀个按钮组如下:HTMLSyncNew PGCSS:.red-outline-button:hover {border-color: #C4213C;background-color: #f8d3d9;color: #000}.gold-outline-button:hover {border-color: #B3892F;background-color: #f4ebd7;color: #000;}以上⼯作。 当我将⿏标悬停在按钮上时,颜⾊会发⽣变化。 但是,当我单击并按住或单击第⼆个按钮以显⽰下拉列表时,颜⾊将切换回默认灰⾊。我试过.red-outline-button:active但没有帮助。我的问题是,在以下情况下设置css颜⾊的正确⽅法是什么:按下按钮打开下拉列表(仅限按钮。我不需要设置实际下拉列表的样式I have a button group as below:HTMLSyncNew PGCSS:.red-outline-button:hover {border-color: #C4213C;background-color: #f8d3d9;color: #000}.gold-outline-button:hover {border-color: #B3892F;background-color: #f4ebd7;color: #000;}The above works. When I hover the mouse over the buttons, the color changes. However, When I click and hold or click thesecond button to reveal the dropdown, then, the color switches back to the default gray.I've tried .red-outline-button:active but that did not question is, what is the right way to set css colour when:Button is pressedDropdown is opened (only the button. I don't need to style the actual dropdown更新时间:2020-06-07 11:06最满意答案您需要覆盖默认的 Bootstrap类:., .btn-default:focus这将适⽤于您不想覆盖所有:.gold-outline-button:hover, ., .gold-outline-button:focus {border-color: #B3892F;background-color: #f4ebd7;color: #000;}希望它能帮到你。 :)You need to override the default Bootstrap classes:., .btn-default:focusThis will work in case you don't want to override all:.gold-outline-button:hover, ., .gold-outline-button:focus {border-color: #B3892F;background-color: #f4ebd7;color: #000;}Hope it helps you. :)相关问答您的html结构与您发布的⽰例不同。 只是改变: $('#button_group_1 button').removeClass('active');对此: $('.btn-group button').removeClass('active');和addClass⼀样...... your html structure is not the same as the example you posted. just change: $('#button_group_1button').r...我有同样的问题,它正在驱使我疯狂! 直到我发现我正在加载bootstrap之前jqueryui ... 我切换了订单并注意到,如果我加载jqueryuiBEFORE引导之前 ,我没有这样的问题:) I had the same problem and it was driving me mad Until I found that I was loadingbootstrap I switched the order and 实际input复选框在花式-group后⾯隐藏( display: none )。 这个div只是看起来像⼀个使⽤CSS和JavaScript切换的复选框。事实上,复选框实际上是在场景后⾯聚焦/标签,你只是⽆法看到它,因为它的隐藏。 如果你不需要,你可以编写明确的JQuery来关注隐藏的复选框时关注外部元素。 这⾥是你需要包含的JQuery代码: $( "input:checkbox" ).focus(function() {if($(this).is(':CSS: .navbar-default .navbar-nav > .open > a,.navbar-default .navbar-nav > .open > a:focus,.navbar-default .navbar-nav > .open > a:hover {background: red;}CSS: .navbar-default .navbar-nav > .open > a,.navbar-default .navbar-nav > .open > 我会建议你使⽤这个简单的CSS来实现你想要的 - /* Change color of dropdown links on hover */.dropdown-menu a:hover {background-color: #f1f1f1}/* Show the dropdown menu on hover */.dropdown:hover .dropdown-menu {display: block;}/* Change the 在Knockout中,你不会使⽤DOM。 您为应⽤程序状态建模并操纵模型。 Knockout绑定负责更新UI。 要更改选择的项⽬,只需设置绑定变量( view )。 在⽰例中,下拉列表将从没有值开始,然后它将被赋予我们想要的值。 vm = {view: able()};indings(vm);// Simulating fetching from cookie and settingsetTimeout(() => ...我设法解决了这个问题。 这只是⼀个愚蠢的错误。 列表中的数据由异步进程填充。 所以我应该在点击下拉按钮后使⽤fakeAsync和tick()。 在将数据填充到列表中之前,视图已更新。 这导致了这个问题。 这是固定的代码: it("Should show options when toggle option isclicked",fakeAsync(() => {Changes();let toggleButton = ...rails中的⼀些奇怪的bug:我的最初是: //= require jquery//= require jquery_ujs//= require jquery-ui//= require bootstrap我不得不重新排序它并在jquery之前移动bootstrap 修改了 //= require bootstrap//= require jquery//= require jquery_ujs//= 您可以使⽤Pseudo Classes:请参阅CSS Pseudo-classes 。 .navbar-inverse .navbar-nav li:first-child:hover {background-color: green;}.navbar-inverse .navbar-nav li:nth-child(2):hover {background-color: lightblue;}.navbar-inverse .navbar-nav 您需要覆盖默认的 Bootstrap类: ., .btn-default:focus这将适⽤于您不想覆盖所有: .gold-outline-button:hover, ., .gold-outline-button:focus {border-color: #B3892F;background-color: #f4ebd7;color: #000;}⼯作演⽰: http : //

发布者:admin,转转请注明出处:http://www.yc00.com/web/1688853202a176670.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信