GVKun编程网logo

html – Bootstrap 4在点击下拉列表时更改插入符号(下拉列表怎么设置html)

9

如果您想了解html–Bootstrap4在点击下拉列表时更改插入符号的相关知识,那么本文是一篇不可错过的文章,我们将对下拉列表怎么设置html进行全面详尽的解释,并且为您提供关于BootstrapS

如果您想了解html – Bootstrap 4在点击下拉列表时更改插入符号的相关知识,那么本文是一篇不可错过的文章,我们将对下拉列表怎么设置html进行全面详尽的解释,并且为您提供关于Bootstrap Split按钮下拉列表、bootstrap 最简单下拉列表、Bootstrap 选择下拉列表占位符 - Bootstrap select dropdown list placeholder、bootstrap下拉列表怎么设置的有价值的信息。

本文目录一览:

html – Bootstrap 4在点击下拉列表时更改插入符号(下拉列表怎么设置html)

html – Bootstrap 4在点击下拉列表时更改插入符号(下拉列表怎么设置html)

使用Bootstrap 4,我尝试使用插入符创建一个下拉列表(例如:指向右侧).在点击下拉列表时,应更改插入符指示方向(例如:向下).

我有一个way to do that

/*Please refer the above link for full code details*/

<ahttps://www.jb51.cc/tag/dio/" target="_blank">dion-toggle" data-toggle="collapse" data-parent="#accordion" href="#collapSEOne">
          Collapsible Group Item #1
</a>

<div id="collapSEOne">
      <div>
        This content is hidden
      </div>
</div>

的CSS

.panel-heading .accordion-toggle:after {
    font-family: 'Glyphicons Halflings';
    content: "\e114";
    float: right;
    color: grey;
}
.panel-heading .accordion-toggle.collapsed:after {
    content: "\e080";
}

但问题是,最初所有的注意力都指向了正确的

还有其他approaches.但我不想使用JQuery,因为我的应用程序是角度4.想尽可能避免使用JQuery / JS.

这不是duplicate的问题.

提前谢谢了…

解决方法

在Bootstrap V4中,他们放弃了Glyphicons.下面的代码将根据您的需要很好地工作.
对于下拉图标样式,您可以使用字体真棒.
[data-toggle="collapse"]:after {
display: inline-block;
    display: inline-block;
    font: normal normal normal 14px/1 FontAwesome;
    font-size: inherit;
    text-rendering: auto;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  content: "\f054";
  transform: rotate(90deg) ;
  transition: all linear 0.25s;
  }   
[data-toggle="collapse"].collapsed:after {
  transform: rotate(0deg) ;
}
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet"/>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-beta/js/bootstrap.min.js"></script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-beta/css/bootstrap.min.css" rel="stylesheet"/>

<div id="accordion" role="tablist">
  <div>
    <divrole="tab" id="headingOne">
      <h5>
        <a data-toggle="collapse" href="#collapSEOne" aria-expanded="true" aria-controls="collapSEOne">
          Collapsible Group Item #1
        </a>
      </h5>
    </div>

    <div id="collapSEOne"role="tabpanel" aria-labelledby="headingOne" data-parent="#accordion">
      <div>
        Anim pariatur cliche reprehenderit,enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute,non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor,sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica,craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table,raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.
      </div>
    </div>
  </div>
  <div>
    <divrole="tab" id="headingTwo">
      <h5>
        <adata-toggle="collapse" href="#collapseTwo" aria-expanded="false" aria-controls="collapseTwo">
          Collapsible Group Item #2
        </a>
      </h5>
    </div>
    <div id="collapseTwo"role="tabpanel" aria-labelledby="headingTwo" data-parent="#accordion">
      <div>
        Anim pariatur cliche reprehenderit,raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.
      </div>
    </div>
  </div>
  <div>
    <divrole="tab" id="headingThree">
      <h5>
        <adata-toggle="collapse" href="#collapseThree" aria-expanded="false" aria-controls="collapseThree">
          Collapsible Group Item #3
        </a>
      </h5>
    </div>
    <div id="collapseThree"role="tabpanel" aria-labelledby="headingThree" data-parent="#accordion">
      <div>
        Anim pariatur cliche reprehenderit,raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.
      </div>
    </div>
  </div>
</div>

这是codepen demo link

注意:在您的演示链接中,他们使用了Bootstrap V3.

Bootstrap Split按钮下拉列表

Bootstrap Split按钮下拉列表

<!DOCTYPE html>
<html>
<head>
   <title>Try v1.2 Bootstrap Online</title>
   <link href=/bootstrap/css/bootstrap.min.css rel=stylesheet>
   <script src=/scripts/jquery.min.js></script>
   <script src=/bootstrap/js/bootstrap.min.js></script>
</head>
<body>

<div class = btn-group>
   <button type = button class = btn btn-default>Default</button>

   <button type = button class = btn btn-default dropdown-toggle data-toggle = dropdown>
      <span class = caret></span>
      <span class = sr-only>Toggle Dropdown</span>
   </button>

   <ul class = dropdown-menu role = menu>
      <li><a href = #>Action</a></li>
      <li><a href = #>Another action</a></li>
      <li><a href = #>Something else here</a></li>

      <li class = divider></li>
      <li><a href = #>Separated link</a></li>
   </ul>
</div>

<div class = btn-group>
   <button type = button class = btn btn-primary>Primary</button>

   <button type = button class = btn btn-primary dropdown-toggle data-toggle = dropdown>
      <span class = caret></span>
      <span class = sr-only>Toggle Dropdown</span>
   </button>

   <ul class = dropdown-menu role = menu>
      <li><a href = #>Action</a></li>
      <li><a href = #>Another action</a></li>
      <li><a href = #>Something else here</a></li>

      <li class = divider></li>
      <li><a href = #>Separated link</a></li>
   </ul>
</div>

</body>
</html>

bootstrap 最简单下拉列表

bootstrap 最简单下拉列表

总结

以上是小编为你收集整理的bootstrap 最简单下拉列表全部内容。

如果觉得小编网站内容还不错,欢迎将小编网站推荐给好友。

Bootstrap 选择下拉列表占位符 - Bootstrap select dropdown list placeholder

问题:

I am trying to make a dropdown list that contains a placeholder.我正在尝试制作一个包含占位符的下拉列表。 It doesn''t seem to support placeholder="stuff" as other forms do.它似乎不像其他形式那样支持placeholder="stuff" Is there a different way to obtain a placeholder in my dropdown?有没有其他方法可以在我的下拉列表中获取占位符?


解决方案:

参考: https://stackoom.com/en/question/1Xl9f

bootstrap下拉列表怎么设置

bootstrap下拉列表怎么设置

本章将重点介绍 bootstrap 下拉菜单。下拉菜单是可切换的,是以列表格式显示链接的上下文菜单。这可以通过与 下拉菜单(dropdown) javascript 插件 的互动来实现。

bootstrap下拉列表怎么设置

如需使用下拉菜单,只需要在 class .dropdown 内加上下拉菜单即可。(推荐学习:Bootstrap视频教程)

下面的实例演示了基本的下拉菜单:

<div>
    <button>主题
        <span></span>
    </button>
    <ul>
        <li>
            <a>Java</a>
        </li>
        <li>
            <a>数据挖掘</a>
        </li>
        <li>
            <a>数据通信/网络</a>
        </li>
        <li>
        <li>
            <a>分离的链接</a>
        </li>
    </ul>
</div>
登录后复制
类 
描述
.dropdown
指定下拉菜单,下拉菜单都包裹在 .dropdown 里 
.dropdown-menu
创建下拉菜单
.dropdown-menu-right
下拉菜单右对齐
.dropdown-header
下拉菜单中添加标题
.dropup
指定向上弹出的下拉菜单
.disabled 
下拉菜单中的禁用项
.divider
下拉菜单中的分割线

更多Bootstrap相关技术文章,请访问Bootstrap教程栏目进行学习!

以上就是bootstrap下拉列表怎么设置的详细内容,更多请关注php中文网其它相关文章!

关于html – Bootstrap 4在点击下拉列表时更改插入符号下拉列表怎么设置html的问题我们已经讲解完毕,感谢您的阅读,如果还想了解更多关于Bootstrap Split按钮下拉列表、bootstrap 最简单下拉列表、Bootstrap 选择下拉列表占位符 - Bootstrap select dropdown list placeholder、bootstrap下拉列表怎么设置等相关内容,可以在本站寻找。

本文标签: