1

我只是在学习如何使用 html 和 css,我的老师要求我们使用 Bootstrap。很明显,这真的很酷,但是当我尝试制作一个按钮时,只有按钮内的文本实际上就像一个链接,而不是整个矩形按钮。我不确定我是否需要的不仅仅是缩小的引导 javascript 文件来使它们工作或什么。

这是我的 html,我还在脑海中添加了“$('.nav-tabs').button()” 行以及来自 bootstrap 的 javascript 文件。有什么建议吗?我知道我的 html 可能很笨拙,我的老师不是最擅长解释事情,所以我一直在摆弄事情,直到它们似乎可以工作。

<div class="btn-toolbar">
    <div class="row-fluid">
        <div class="span2 offset2">
        <div class="btn btn-primary">
            <a href="http://students.cec.wustl.edu/~amd4/Portfolio/portfolio%20-%20profile%20-%20final.html">
                Profile
            </a>
        </div>
    </div>
    <div class="span2 offset.5">
        <div class="btn">
            <a href="http://students.cec.wustl.edu/~amd4/Portfolio/portfolio%20-%20writing%20-%20final.html">
                Writing
            </a>
        </div>
    </div>
    <div class="span2 offset.5">
        <div class="btn">
            <a href="http://students.cec.wustl.edu/~amd4/Portfolio/portfolio%20-%20music%20-%20final.html">
                Music
            </a>
        </div>
    </div>
    <div class="span2 offset.5">
        <div class="btn">
            <a href="http://students.cec.wustl.edu/~amd4/Portfolio/portfolio%20-%20photos%20-%20final.html">
                Photography
            </a>
        </div>
    </div>
</div>
4

2 回答 2

2

remove the class="btn btn-primary" from the div tag, put it on the a tag

see http://twitter.github.com/bootstrap/base-css.html#buttons

...typically you'll want to apply these to only <a> and <button> elements for the best rendering.

于 2013-03-29T17:40:27.663 回答
1

Looks like you are not adding the class on the a tag. You need to use something like this <a href="#" class="btn btn-primary">New button</a> This should give you a button with the text New button.

You use <a href="#" class="btn btn-primary btn-large">Big Button</a>

For a large blue button.

于 2013-03-29T17:41:55.467 回答