2017-11-11 96 views
0

我仍然是JavaScript中的新成員,尤其是在reactjs中。創建網頁標題時遇到問題。我想把菜單放在右邊,然後我使用。但它不起作用,菜單停留在左側。我正在使用布爾瑪爲CSS。誰能幫忙?標籤navbar在Reactjs中不起作用

import React, { Component } from 'react'; 
import './Header.css'; 
import { Link } from 'react-router-dom'; 

class Header extends Component { 

    render() { 
    return (
     <div className="nav has-shadow"> 
     <div className="container"> 
     <div className="nav-left"> 
      <a className="nav-item">MyCompany</a> 
     </div> 

     <span className="nav-toggle" > 
      <span></span> 
      <span></span> 
      <span></span> 
     </span> 

     <div className="nav-right nav-menu"> 

      <Link to="/" className="nav-item r-item">Home</Link> 
      <Link to="/faq" className="nav-item r-item">Features</Link> 
      <Link to="/faq" className="nav-item r-item">About</Link> 
      <Link to="/faq" className="nav-item r-item">faq</Link> 



      <div className="nav-item"> 
      <p className="control"> 
       <a className="button is-primary is-outlined"> 
       <span className="icon"> 
        <i className="fa fa-download"></i> 
       </span> 
       <span>Join Now</span> 
       </a> 
      </p> 
      </div> 

     </div> 
     </div> 
    </div> 

    ); 
    } 
} 

export default Header; 

回答

0

使用navbar-end類來把你的菜單內容右側像

<nav class="navbar"> 
    <div class="navbar-end"> 
     <div class="navbar-item"> 
      <!-- Your content here --> 
     </div> 
    </div> 
</nav> 

對於有關文檔的頁眉/導航欄在布爾瑪CSS參考Navbar | Bulma

+1

謝謝!只需使用即可將菜單放在右側,並且可以正常工作。 –