# bootstrap下拉按钮大小不一致问题

(adsbygoogle = window.adsbygoogle || []).push({});

在使用bootstrap下来按钮遇到一个问题,运行示例代码主按钮和拉下按钮两个大小不一致:

<div class="btn-group">
  <a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
    选择类型
    <span class="caret"></span>
  </a>
  <ul class="dropdown-menu">
    <!-- 下拉菜单的链接 -->
  </ul>
</div>

解决: 在页面首行增加h5标识:

<!DOCTYPE html>

bootstrap文档专门有说明

Bootstrap makes use of certain HTML elements and CSS properties that
require the use of the HTML5 doctype. Include it at the beginning of
all your projects.
Last Updated: 6/30/2021, 6:09:42 PM