问题
My Navigation code as:-
const Navigation = (props) => {
console.log(props);
return (
<Navbar bg="primary" variant="dark">
<Navbar.Brand href="/">Dating Service</Navbar.Brand>
<Navbar.Toggle aria-controls="basic-navbar-nav" />
<Navbar.Collapse id="basic-navbar-nav">
<Nav className="ml-auto">
<Nav.Link href="/">Home</Nav.Link>
<Nav.Link href="/CreateProfile">Create Profile</Nav.Link>
<Nav.Link href="/ViewProfile">View Profile</Nav.Link>
</Nav>
</Navbar.Collapse>
</Navbar>
)
}
export default withRouter(Navigation);
It looks like this:-
The whole page is aligned center. How can make it left aligned?
回答1:
I could fix it by this:-
npm install bootstrap
Later add import 'bootstrap/dist/css/bootstrap.min.css';
Also, it is possible that we can include bootstrap.min.css cdn directly at public/index.html without installing bootstrap.
来源:https://stackoverflow.com/questions/60469800/how-to-align-left-navbar-react-bootstrap