[英]How can I display the content of my webpage in center using react bootstrap
I am designing a webpage for a desktop using react-bootstrap.我正在使用 react-bootstrap 为桌面设计网页。 I have in my webpage logo, Main heading and form, and some links after the display of the form, I want to display all my content in the center of the webpage.
我在我的网页徽标,主标题和表格以及表格显示后的一些链接中,我想在网页中央显示我的所有内容。 How can I accomplish it using bootstrap flexbox
如何使用引导程序 flexbox 完成它
You can give the most parent div
or element
in your app a className
and apply flexbox
properties to it.您可以为应用程序中最父级的
div
或element
提供一个类名,并flexbox
className
。
const App = () => {
return (
<div className='d-flex align-items-center justify-content-center'>...</div> // <--------Most parent div-------->
)
}
If you only want to center
the content horizontally
then only apply justify-content
otherwise apply both.如果您只想将内容
horizontally
center
,则只应用justify-content
否则两者都应用。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.