reactjs - React-Bootstrap 中的间距和边距实用程序

标签 reactjs react-bootstrap

我是 ReactJS 初学者。 React-Bootstrap 中是否有像 Bootstrap 中的 mt-4p-5mx-auto 等那样的间距和边距实用程序类?

我正在查看 React-Bootstrap 的文档并在很多平台上进行了搜索,但没有找到正确的答案。

最佳答案

您可以使用Bootstrap,只需将Bootstrap的类添加到组件中即可正常工作。 例如对于组件标题:

class Header extends React.Component {
 <div className='mt-5'> //margin-top 5px

 {..content here}
 </div>
}

记住将 Bootstrap 添加到项目的 index.html 文件

<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">

关于reactjs - React-Bootstrap 中的间距和边距实用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53758946/

相关文章:

javascript - 尝试创建 React 应用程序时出现 Yarn 错误

javascript - React.js 和 webpack - 为什么它不允许 var、let、const?

css - 使用 Material UI 时动画未触发

javascript - 带有 document.getElementById 的 Reactjs 样式组件

javascript - npm 错误!过早关闭

javascript - 使用手机时如何隐藏一个 svg 并显示另一个?

javascript - 带有输入的 React-Bootstrap 下拉列表不会保持打开状态

javascript - 错误 : Hydration failed because the initial UI does not match what was rendered on the server with useSession() and react-bootstrap

reactjs - TS2307 : Cannot find module 'react-bootstrap'

javascript - 使用 react Bootstrap 的下拉列表在小移动屏幕上无法正常工作