gpt4 book ai didi

css - 如何设置 dropDownButton 的样式?

转载 作者:太空宇宙 更新时间:2023-11-04 10:02:52 25 4
gpt4 key购买 nike

我想改变下拉按钮的颜色,让它看起来像“btn btn-primary”。但它也会改变所有菜单项的颜色,并将它们向右移动。这是原始下拉菜单的样子: enter image description here

然后我设计成这样:

        <xp_1:dropDownButton id="dropDownButton1">
<xp_1:this.treeNodes>
<xp_1:basicContainerNode label="Open"
styleClass="btn btn-primary">
<xp_1:this.children>
<xp_1:basicLeafNode label="item1">
</xp_1:basicLeafNode>
<xp_1:basicLeafNode label="item2">
</xp_1:basicLeafNode>
<xp_1:basicLeafNode label="item3">
</xp_1:basicLeafNode>
</xp_1:this.children>
</xp_1:basicContainerNode>
</xp_1:this.treeNodes>
</xp_1:dropDownButton>

然后我得到:

enter image description here

那么我如何只设置 OPEN 下拉按钮的样式,但将菜单项保留为默认样式,使其位于按钮下方而不是右侧。我对这种样式有误,所以我也不知道如何添加按钮图标。

生成的 HTML:

<html lang="en">
<head>
<title></title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" type="text/css" href="/xsp/.ibmxspres/.mini/css/@B3r&amp;@B3o&amp;@B3m&amp;@B3p&amp;@B3s.css">
<script type="text/javascript">var dojoConfig = {locale: 'en-us'};</script>
<script type="text/javascript" src="/xsp/.ibmxspres/dojoroot-1.9.7/dojo/dojo.js"></script>
<script type="text/javascript" src="/xsp/.ibmxspres/.mini/dojo/.en-us/@Iq.js"></script>
<script type="text/javascript">dojo.require("ibm.xsp.widget.layout.xspClientDojo")</script>
<script type="text/javascript" src="/xsp/.ibmxspres/.extlib/responsive/jquery/jquery.min.js"></script>
<script type="text/javascript" src="/xsp/.ibmxspres/.extlib/responsive/bootstrap3/js/bootstrap.min.js"></script>
<script type="text/javascript" src="/xsp/.ibmxspres/.extlib/responsive/xpages/js/xsp-mixin.js"></script>
</head>
<body class="xsp dbootstrap bootstrap-theme">
<form id="view:_id1" method="post" action="/t_dir/myDb.nsf/TEST.xsp?bpp=1" enctype="multipart/form-data">
<div class="btn-group"><div class="btn-group"><button type="button" id="view:_id1:dropDownButton1_ab_0" data-toggle="dropdown" class="btn btn-primary btn btn-default dropdown-toggle">Open <span class="caret"></span></button>
<ul class="btn btn-primary dropdown-menu">
<li class="menu-item"><a>item1</a></li>
<li class="menu-item"><a>item2</a></li>
<li class="menu-item"><a>item3</a></li>
</ul>
</div>
</div>

<input type="hidden" name="$$viewid" id="view:_id1__VUID" value="!710qd094s9ihvkilfn1r22sda!">
<input type="hidden" name="$$xspsubmitid">
<input type="hidden" name="$$xspexecid">
<input type="hidden" name="$$xspsubmitvalue">
<input type="hidden" name="$$xspsubmitscroll">
<input type="hidden" name="view:_id1" value="view:_id1"></form>
</body>
</html>

最佳答案

为您的元素创建一个具有背景颜色的特定类?像那样http://www.w3schools.com/css/css_dropdowns.asp

关于css - 如何设置 dropDownButton 的样式?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38227939/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com