Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/reactjs/22.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/templates/2.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
Reactjs React Boostrap编辑字段不尊重col-N类名称_Reactjs_Bootstrap 4_React Bootstrap - Fatal编程技术网

Reactjs React Boostrap编辑字段不尊重col-N类名称

Reactjs React Boostrap编辑字段不尊重col-N类名称,reactjs,bootstrap-4,react-bootstrap,Reactjs,Bootstrap 4,React Bootstrap,我试图创建3个标签编辑字段,水平放置的形式,所有6个组件(标签编辑标签编辑)应具有相同的宽度和间距。我的代码是: package.json: { "name": "react", "version": "1.0.0", "description": "React example starter project", "keywords": [&

我试图创建3个标签编辑字段,水平放置的形式,所有6个组件(标签编辑标签编辑)应具有相同的宽度和间距。我的代码是:

package.json:

{
  "name": "react",
  "version": "1.0.0",
  "description": "React example starter project",
  "keywords": ["react", "starter"],
  "main": "src/index.js",
  "dependencies": {
    "react": "17.0.2",
    "react-dom": "17.0.2",
    "react-scripts": "4.0.0",
    "jquery": "^3.3.1",
    "bootstrap": "^4.1.3",
    "popper.js": "^1.14.3"
  },
  "devDependencies": {
    "@babel/runtime": "7.13.8",
    "typescript": "4.1.3"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test --env=jsdom",
    "eject": "react-scripts eject"
  },
  "browserslist": [">0.2%", "not dead", "not ie <= 11", "not op_mini all"]
}
{
“名称”:“反应”,
“版本”:“1.0.0”,
“说明”:“反应示例启动程序项目”,
“关键词”:[“反应”、“起动器”],
“main”:“src/index.js”,
“依赖项”:{
“反应”:“17.0.2”,
“react dom”:“17.0.2”,
“反应脚本”:“4.0.0”,
“jquery”:“^3.3.1”,
“引导”:“^4.1.3”,
“popper.js”:“^1.14.3”
},
“依赖性”:{
“@babel/runtime”:“7.13.8”,
“类型脚本”:“4.1.3”
},
“脚本”:{
“开始”:“反应脚本开始”,
“构建”:“反应脚本构建”,
“测试”:“反应脚本测试--env=jsdom”,
“弹出”:“反应脚本弹出”
},

“browserslist:“[”>0.2%,“not dead”,“not ie”您不能嵌套这样的列。列必须是一行的直接子列。因此,如果您希望标签/输入是其
col-4
容器的一半,请在容器内创建另一行,并使它们都
col-6
。也就是说,不要这样做:

<div className="form-group col-4">
  <label for="gen_ref_num" className="col-2 control-label">
    Serie
  </label>
  <input
    type="text"
    className="col-2 form-control"
    id="gen_ref_num"
  />
</div>

塞列
你有这个:

<div className="form-group col-4">
  <div className="row">
    <label for="gen_ref_num" className="col-6 control-label">
      Serie
    </label>
    <input
      type="text"
      className="col-6 form-control"
      id="gen_ref_num"
    />
  </div>
</div>

塞列
<div className="form-group col-4">
  <div className="row">
    <label for="gen_ref_num" className="col-6 control-label">
      Serie
    </label>
    <input
      type="text"
      className="col-6 form-control"
      id="gen_ref_num"
    />
  </div>
</div>