我正在研究反应项目,因为我有一个锚标签,然后我有一个导航栏。问题是锚标签将导航栏推到右侧。因为锚标签占用了额外的空白。我什至尝试过使用display: 'inline-block',但它不起作用。
Navbar.js
import React, { Component } from 'react';
import './Navbar.css';
import { Link } from 'react-router-dom';
class Navbar extends Component {
render() {
return (
<div className='container-fluid custom'>
<div className='container'>
<div className='row'>
<div className='col-12'>
<nav className="navbar navbar-expand-lg navbar-light bg-light">
<a className="navbar-brand space" href="www.facebook.com">
<div className='logo'>
<img src='assets/images/kaboom.png' alt='logo'></img>
</div>
</a>
<button className="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span className="navbar-toggler-icon"></span>
</button>
<div className="collapse navbar-collapse" id="navbarNav">
<ul className="navbar-nav">
<li className="nav-item active">
<Link className='nav-link' to='/'>Home</Link>
</li>
</li>
</ul>
</div>
</nav>
</div>
</div>
</div>
</div>
)
}
}
茅侃侃
一只名叫tom的猫
相关分类