Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/linq/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Twitter bootstrap 引导代码结构_Twitter Bootstrap - Fatal编程技术网

Twitter bootstrap 引导代码结构

Twitter bootstrap 引导代码结构,twitter-bootstrap,Twitter Bootstrap,我试图在bootstrap中创建一个表单,我对我正在做的工作有一些疑问 1.我们将表单元素放在html中的什么位置?它必须在表格的开头吗 2.我有一个重复行的表,建议使用div还是只使用table 3.是否必须先放置div.row,然后再放置div.form-group?这是最佳做法还是我可以直接使用form group而不使用div.row作为父级 4.如果无法作为div来控制表内td的大小,如何控制它?我在表单中使用了一个表,我需要td contains datepicker比包含注释的td

我试图在bootstrap中创建一个表单,我对我正在做的工作有一些疑问

1.我们将表单元素放在html中的什么位置?它必须在表格的开头吗

2.我有一个重复行的表,建议使用div还是只使用table

3.是否必须先放置div.row,然后再放置div.form-group?这是最佳做法还是我可以直接使用form group而不使用div.row作为父级

4.如果无法作为div来控制表内td的大小,如何控制它?我在表单中使用了一个表,我需要td contains datepicker比包含注释的td小

如果有什么不清楚的地方,请告诉我。谢谢大家

<div class="row">
    <div class="col-sm-6">
        <form>
            <div class="form-group">
                <label for="exampleInputEmail1">Email address</label>
                <input type="email" class="form-control" id="exampleInputEmail1" placeholder="Email">
            </div>
            <div class="form-group">
                <label for="exampleInputPassword1">Password</label>
                <input type="password" class="form-control" id="exampleInputPassword1" placeholder="Password">
            </div>
            <div class="form-group">
                <label for="exampleInputFile">File input</label>
                <input type="file" id="exampleInputFile">
                <p class="help-block">Example block-level help text here.</p>
            </div>
            <div class="checkbox">
                <label>
                    <input type="checkbox"> Check me out
                </label>
            </div>
            <button type="submit" class="btn btn-default">Submit</button>
        </form>
    </div>
    <div class="col-sm-6">
        <form>
            <div class="form-group">
                <label for="exampleInputEmail1">Email address</label>
                <input type="email" class="form-control" id="exampleInputEmail1" placeholder="Email">
            </div>
            <div class="form-group">
                <label for="exampleInputPassword1">Password</label>
                <input type="password" class="form-control" id="exampleInputPassword1" placeholder="Password">
            </div>
            <div class="form-group">
                <label for="exampleInputFile">File input</label>
                <input type="file" id="exampleInputFile">
                <p class="help-block">Example block-level help text here.</p>
            </div>
            <div class="checkbox">
                <label>
                    <input type="checkbox"> Check me out
                </label>
            </div>
            <button type="submit" class="btn btn-default">Submit</button>
        </form>
    </div>
</div>
这是一个在sm中有两列的示例。其他尺寸的xs、md、lg不包括在内。这意味着,你有整个屏幕的宽度在xs,md,lg。等于,例如,在lg col-lg-12中。宽度,您可以使用列xs-。。。山柱-。。。col md-。。。col lg-

没有必要为此使用。始终作为父级使用。要更改宽度,请选择col类。该类行的左边距和右边距分别为15px:

<div class="row">
    <div class="col-sm-... col-md-...">
    Content
    </div>
</div>

评论被删除,因为它们没有帮助。请不要继续这样说。谢谢@ChrisF:谢谢你的回答谢谢:但是如果我有一个重复表,例如,一个记录过去工作经验的表,如果我使用div.row,然后你将浏览器的大小更改为较小的大小,那会破坏设计,也许在较小的浏览器或手机上,这就是我们需要使用表格来显示水平内联滚动的地方?实际上我不知道。在您发布的示例中,您使用了一行,并向其中添加了所有内容。对于将在浏览器中显示的每个水平行,我都有多行,对吗?谢谢。请用一些相关的HTML更新你的问题,看看你真正的意思。谢谢