I am building a Website with react and I applied Reactbootstrap for Navbar and Carousel. For Footer MdBootstrap.
I get the Problem that my Navbar is not displayed inline and there is a padding right and left on navbar and Carousel.
Could someone please help me to fix that?
Here my CustomNavbar.jsx and CustomNavbar.css:
import React, { Component } from 'react'
import { Navbar, Nav, NavItem } from 'react-bootstrap';
import { Link } from 'react-router-dom';
import './CustomNavbar.css'
export default class CustomNavbar extends Component {
render() {
return (
<Navbar default collapseOnSelect fluid={true}>
<Navbar.Header>
<Navbar.Brand>
<Link to="/">CodeLife</Link>
</Navbar.Brand>
<Navbar.Toggle/>
</Navbar.Header>
<Navbar.Collapse>
<Nav>
<NavItem eventKey={1} componentClass={Link} href="/" to="/">
Home
</NavItem>
<NavItem eventKey={2} componentClass={Link} href="/about" to="/about">
About
</NavItem>
<NavItem eventKey={3} componentClass={Link} href="/news" to="/news">
News
</NavItem>
</Nav>
</Navbar.Collapse>
</Navbar>
)
}
}
nav.navbar, .navbar-default {
background-color: #2892D7 !important;
margin-bottom: 0;
margin:0;
padding:0;
}
.navbar-default {
background-image: none;
border: none;
border-radius: 5px;
margin:0;
padding:0;
}
.navbar-default .navbar-nav > li > a {
color: white;
margin-bottom: 0;
position: relative;
display: block;
margin:0;
padding:0;
}
.navbar-default .navbar-brand {
color: white;
margin-bottom: 0;
margin:0;
padding:0;
}
.navbar-default .navbar-toggle {
border-color: white;
margin-bottom: 0;
margin:0;
padding:0;
}
.navbar-default .navbar-toggle .icon-bar {
background-color: white;
margin:0;
padding:0;
}
.navbar-default .navbar-toggle:focus, .navbar-default .navbar-toggle:hover {
background-color: transparent;
margin-bottom: 0;
margin:0;
padding:0;
}
.navbar-default .navbar-brand:focus, .navbar-default .navbar-brand:hover {
color: white;
background-color: transparent;
margin-bottom: 0;
margin:0;
padding:0;
}
.navbar-default .navbar-nav>li>a:focus, .navbar-default .navbar-nav>li>a:hover {
color: white;
background-color: transparent;
margin-bottom: 0;
margin:0;
padding:0;
}
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…