【发布时间】:2018-09-24 16:29:07
【问题描述】:
在这个 sn-p 中,我想在两个 col 空格之后看到按钮,但是按钮被拉到左边,无论我做什么,它都没有得到更新。
{ values.contact_persons_attributes.length < 2 &&
<div className="row">
<div className="col-md-4 col-md-offset-2">
<button className="btn btn-info waves-effect waves-light" type="button" onClick={() => arrayHelpers.push({id: '', name: '', email: '', mobile_no: '', is_representative: false})}><span className="btn-label"><i className="fa fa-plus"></i></span>Add Contact Person</button>
</div>
</div>
}
【问题讨论】:
-
这不起作用,因为
col-md-offset-2在 Bootstrap 4 中是offset-md-2。Read the docs -
检查按钮并打开计算的样式。查找位置、显示、边距、填充。左,右属性。查看是否有问题,并将相关信息粘贴到您的问题中。
-
@ZimSystem 我也试过了,它不起作用。
-
@MotiKorets 我幸运地找到了替代方案,
className="col-md-11 ml-md-auto"。这确实对我有用,并给了我想要的输出。 -
我认为您应该将其添加为答案,以便问题显示为已解决。
标签: javascript twitter-bootstrap reactjs bootstrap-4