【问题标题】:Bootstrap offset not working in react app, when used with a button与按钮一起使用时,引导偏移在反应应用程序中不起作用
【发布时间】: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-2Read the docs
  • 检查按钮并打开计算的样式。查找位置、显示、边距、填充。左,右属性。查看是否有问题,并将相关信息粘贴到您的问题中。
  • @ZimSystem 我也试过了,它不起作用。
  • @MotiKorets 我幸运地找到了替代方案,className="col-md-11 ml-md-auto"。这确实对我有用,并给了我想要的输出。
  • 我认为您应该将其添加为答案,以便问题显示为已解决。

标签: javascript twitter-bootstrap reactjs bootstrap-4


【解决方案1】:

幸运的是,我找到了替代方案,className="col-md-11 ml-md-auto"。这确实对我有用,并给了我想要的输出。

【讨论】:

    猜你喜欢
    • 2018-08-07
    • 1970-01-01
    • 2019-02-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-12-30
    • 2020-08-27
    • 1970-01-01
    相关资源
    最近更新 更多