将div放入其中

时间:2016-11-08 17:42:36

标签: html css

我的页脚中有一个div,我想放入一个内容。 我尝试了这个,但它不会把div放在按钮内。我在这里找到了 http://www.w3schools.com/bootstrap/tryit.asp?filename=trybs_dropdown-menu-dropup&stacked=h

这就是它的作用 https://jsfiddle.net/tmfmtocf/ 有谁知道如何做到这一点? 我的页脚......

    <footer id="chat">
        <div class="dropup">
            <button class="btn btn-default dropdown-toggle" type="button" data-toggle="dropdown">
                Dropup Example
                <span class="caret"></span>
            </button>
            <div class="boxContainer">
                <h2 style="color:red;">Chat</h2>
                <div id="scrollBox" style="height:100px;width:100%;font:16px/26px Georgia, Garamond, Serif;overflow:auto;">
                    <ul id="discussion"></ul>
                </div>
                <input type="text" id="message" />
                <input type="button" id="sendmessage" value="Send" />
                <input type="hidden" id="displayname" />
            </div>
       </div>
</footer>

谢谢!

1 个答案:

答案 0 :(得分:0)

如果您已在页面上加载了引导程序,则只需将dropdown-menu类添加到boxContainer,如下所示:

    <footer id="chat">
        <div class="dropup">
            <button class="btn btn-default dropdown-toggle" type="button" data-toggle="dropdown">
                Dropup Example
                <span class="caret"></span>
            </button>
            <div class="boxContainer dropdown-menu">
                <h2 style="color:red;">Chat</h2>
                <div id="scrollBox" style="height:100px;width:100%;font:16px/26px Georgia, Garamond, Serif;overflow:auto;">
                    <ul id="discussion"></ul>
                </div>
                <input type="text" id="message" />
                <input type="button" id="sendmessage" value="Send" />
                <input type="hidden" id="displayname" />
            </div>
       </div>
</footer>

小提琴演示Fiddle