dyoung
dyoung

Reputation: 107

CSS / R shiny: removing padding below navbar

I'm working on a shiny app but have very little web development expertise. I'm wondering what CSS element/class I need to modify to remove the white space between the top navigation bar and the rest of the page (indicated by the red arrow below).

I used the document explorer (F12) in my browser, and it seems that section is called navbar navbar-default navbar-static-top so I tried adding the following CSS to the page:

.navbar .navbar-default .navbar-static-top {padding: 0px; !important}

But it had no effect. I've gotten other CSS to work for my app (e.g., background color), but this one is stubborn. Any help would be much appreciated! Thanks in advance.

enter image description here

Upvotes: 1

Views: 625

Answers (2)

Aaryaman Maheshwari
Aaryaman Maheshwari

Reputation: 111

Found the solution-

Setting the margin-bottom of .navbar .navbar-default .navbar-static-top to 0 works.

Cheers

Upvotes: 3

Shimi
Shimi

Reputation: 1218

The problem is the margin-bottom that is being applied from the nav, setting it to zero solved the problem for me as you can see on the screenshot. (Sharing your site was very helpful to troubleshoot)

.navbar .navbar-default .navbar-static-top {margin-bottom: 0px}

enter image description here

Upvotes: 1

Related Questions