Search code examples
cssreactjsreact-flexbox-grid

How to make a Navbarl like this in React using flexbox


How to make a component like this using flexbox in Reactjs?

enter image description here


Solution

  • You don't really need flex box to do this, but heres a close representation to what you're looking for. You'll have to change the font family as well

    <!DOCTYPE html>
    <html lang="en">
    
    <head>
      <meta charset="UTF-8">
      <meta name="viewport" content="width=device-width, initial-scale=1.0">
      <meta http-equiv="X-UA-Compatible" content="ie=edge">
      <title>Bradey Whitlock</title>
    </head>
    
    <body style="margin: 0px">
      <div style="background-color:#28AF42; height: 50px; display: flex; align-items: center; justify-content: space-around; font-family: monospace">
      <div style="color: white; font-size: 25px">edibit</div>
      <div style="display: flex; justify-content: space-around">
        <div style="background-color:#28AF42; border: 1px solid white; border-radius: 3px; padding: 3px 15px; color: white; margin-right: 20px; cursor: pointer">Sign In</div>
        <div style="background-color:#28AF42; border: 1px solid white; border-radius: 3px; padding: 3px 15px; color: white; cursor: pointer">Register</div>
      </div>
      </div>
    </body>
    
    </html>