我有两个表单组,其中有一个标签和输入文本框。标签和输入文本框都有类名 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>
答案 0 :(得分:0)
创建HTML元素时,请使用属性class
而不是className
。 Element.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 ">
答案 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
属性。