Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

reactstrap <Navbar> fixed on top

Tags:

reactstrap

I'm using reactstap and try to implement a navbar being fixed, which works partially, since the navbar is fixed, but the very next component moves to the top (behind the navbar). If the fixed attribute is not set, the content appears correctly below the navbar.

<Navbar className="bg-dark" color="dark" fixed="top" >
like image 659
Spooky Fox Avatar asked Jan 17 '26 23:01

Spooky Fox


1 Answers

You can add a margin or padding to the top of the body to move it down to compensate for the height of your navbar.

Add to your stylesheet:

body {
  padding-top: 45px;
}

or add it to your body or main tag as an inline style.

like image 170
brooksrelyt Avatar answered Jan 19 '26 19:01

brooksrelyt



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!