引导类Col-md-6 col-lg-6在表单组中不起作用(溢出)

时间:2016-12-06 01:47:09

标签: twitter-bootstrap twitter-bootstrap-3

我有两个表单组,其中有一个标签和输入文本框。标签和输入文本框都有类名 col-md-6 col-lg-6 。由于标签内的文本太长,tt将第二个标签推入下半部分(标签正在推入文本框列)。如何在左半部分设置标签,在右半部分设置输入元素(即使标签太长)?

    <div className="col-lg-6 col-md-6 col-sm-6 col-xs-6 ">

      <div className="form-group">

    <div className="form-inline"><Field name="no" component=    type="checkbox" /> No</div>                                             
       </div>
           </div>

2 个答案:

答案 0 :(得分:0)

创建HTML元素时,请使用属性class而不是classNameElement.className是DOM元素的属性(在Javascript中)。

e.g。

<div className="col-lg-6 col-md-6 col-sm-6 col-xs-6 ">

应该是

<div class="col-lg-6 col-md-6 col-sm-6 col-xs-6 ">

请参阅this plunker example

答案 1 :(得分:0)

问题:没有名为/** * Zip a collection of files and pipe the output to an InputStream */ public static InputStream zipSource(Collection<Path> paths) throws IOException { // Pipe pair. We zip to the output stream in a separate thread. The data is // then available to be read from the input stream. PipedOutputStream out = new PipedOutputStream(); PipedInputStream in = new PipedInputStream(out); // Zip the file to the input stream in another thread zipExecutor.execute(() -> { try { zip(paths, out); } catch (IOException e) { System.err.println("Zip failed " + e); } }); return in; } /** * Zip a collection of files to an output stream */ public static void zip(Collection<Path> paths, OutputStream out) throws IOException { try (ZipOutputStream zout = new ZipOutputStream(out)) { for (Path path : paths) { zout.putNextEntry(new ZipEntry(path.getFileName().toString())); Files.copy(path, zout); zout.closeEntry(); } } } private static final Executor zipExecutor = Executors.newCachedThreadPool(r -> { Thread t = new Thread(r, "zip task"); t.setDaemon(true); return t; }); 的HTML属性,您已在所有元素中使用过它。

解决方案:className的所有匹配项更改为className,并且必须有效。

注意class Javascript 中用于操纵任何给定元素的className属性。