Bootstrap 4 引导容器流体div中的中心内容

Bootstrap 4 引导容器流体div中的中心内容,bootstrap-4,Bootstrap 4,在ContainerFluid中,我了解了如何使用任何引导类将该内容设置为中心。我可以使用边距和填充,但我不想使用边距和填充。请帮助实现这一目标 这是App.js import React, { Component } from 'react'; import './App.css'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { faSuitcase } from '@fortawesome

在ContainerFluid中,我了解了如何使用任何引导类将该内容设置为中心。我可以使用边距和填充,但我不想使用边距和填充。请帮助实现这一目标

这是App.js

import React, { Component } from 'react';
import './App.css';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faSuitcase } from '@fortawesome/free-solid-svg-icons';


class App extends Component {
  render() {
    return (
      <div className='container-fluid customcolor'>
        <div className='row'>
          <div className='icon'>
            <FontAwesomeIcon className='suitcasestyle fa-5x' icon={faSuitcase}></FontAwesomeIcon>
          </div>
          <div className='text'>
            <h1>Job Application</h1>
            <h3>Please complete the form below to apply for a position with us.</h3>
          </div>
        </div>
      </div>
    )
  }
}

export default App

如果需要对齐文本中心,则需要将class
text center
添加到
container fluid
div中

如果需要对齐内部内容,则需要将class
justify content center
添加到相应的行中。否则,您需要在行周围有另一个div包装器

例如:

d-flex
是必需的

另外,
应具有class
col
col-*

我会写这样的东西


工作
请核对一下。
.customcolor {
  background-color: red;
}