简体   繁体   English

如何使用反应引导程序在中心显示我的网页内容

[英]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.您可以为应用程序中最父级的divelement提供一个类名,并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.

相关问题 如何使用反应在网页上动态显示元掩码地址 - How can I display the metamask address on the webpage dynamically using react react native:如何使用平面列表显示数据内容? - react native: How can I display the data content using a flatlist? 如何在 React 导出的网页上显示承诺的结果 - How can I display the result of a promise on a webpage in a react export 如何将内容从博客中提取到我的网页上? - How can I pull content from blogger onto my webpage? 如何使用内部宽度按比例缩放我的网页以适应任何显示尺寸? - How can I scale my webpage proportionally using inner width to fit any display size? 如何在网页上显示上载的.ppt文件? - How can I display an uploaded .ppt file on my webpage? 如何在网页上显示JSON中的数据? - How can I display the data from the JSON on my webpage? 如何将我的谷歌地图信息 window 内容居中? - How can I center my google maps info window content? 如何显示带有GridView中html内容的Bootstrap弹出窗口? - How can I display a Bootstrap popover with an html content from a GridView? 如何在网页加载时显示加载内容,并在页面完全加载时隐藏该内容? - How can I show load content while my webpage is loading and hide this content when the page is fully loaded?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM