0

How can I extend my header to the full page? I have tried margin-left & right but that doesn't work.

Header.css

    background: green;
    height: 70px;
    width: 100%;
    display: flex;
    justify-content: space-between;
    margin-bottom: 25px;
    left: 0;
    right: 0;
} 


  .header-right {
    float: right;
  }

  @media screen and (max-width: 500px) {
    .header-right {
      float: none;
    }
  }

Here's my app.tsx file:

const Header = () => (
  <div className = 'header'>
  <h1>Instaride</h1>
  <div className="header-right">
    <Button> Sign In</Button>
    <Button> Contact</Button>
  </div>
</div>
);

export default Header;

enter image description here

1
  • 1
    Can you share your container CSS code? Commented Feb 1, 2020 at 20:48

1 Answer 1

1

Looks like there could be a margin for your body element. Try setting:

body{
    margin: 0;
}
Sign up to request clarification or add additional context in comments.

6 Comments

I tried this in the header but it doesn't work.
Any chance you could post the html?
See the updated qs
For html classes the correct syntax is <div class=' className '> rather than <div className = ' ' > Not sure if this is related to the problem
This is react. React only has classNames and not class
|

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.