如何制作twitter bootstrap“colspan = 2”

时间:2012-08-08 15:16:18

标签: css twitter-bootstrap

我正在使用twitter bootstrap,我有一个表单。我需要第一行像“colspan = 2” 我希望我足够清楚......我怎么能这样做?

这是我的代码:

<form class="form-horizontal">
    <fieldset>
        I Need this row to be like "colspan=2" in table td
        <div class="control-group">
            <label class="control-label" for="my_input">field name</label>
            <div class="controls">
                <input type="text" class="input-xlarge" id="my_input" name="my_input"/>
            </div>
        </div>
        <div class="control-group">
            <label class="control-label" for="my_input">field name</label>
            <div class="controls">
                <input type="text" class="input-xlarge" id="my_input" name="my_input"/>
            </div>
        </div>
    </fieldset>
</form>

这是jsFiddle:http://jsfiddle.net/3j7QP/7/

1 个答案:

答案 0 :(得分:1)

那样:http://jsfiddle.net/3j7QP/16/

<form class="form-horizontal">
    <fieldset>
        <div style="float: left; width: 100px; height: 80px; background: red;">
            xxx
        </div>

        <div class="control-group" style="float:left;">
            <label class="control-label" for="my_input">field name</label>
            <div class="controls">
                <input type="text" class="input-xlarge" id="my_input" name="my_input"/>
            </div>
        </div>
        <div class="control-group" style="float:left;">
            <label class="control-label" for="my_input">field name</label>
            <div class="controls">
                <input type="text" class="input-xlarge" id="my_input" name="my_input"/>
            </div>
        </div>
    </fieldset>
</form>