Bootstrap: How to add buttons of sizes other than medium in navbar (and keep vertical alignment)?

Created on 20 Sep 2016  路  9Comments  路  Source: twbs/bootstrap

Code:

<li class="nav-item"><a class="btn btn-outline-secondary bg-inverse btn-sm">Support</a></li>
<li class="nav-item"><a class="btn btn-outline-secondary bg-inverse">Log in</a></li>
<li class="nav-item"><a class="btn btn-outline-secondary bg-inverse">Sign up</a></li>

Screenshot:

screen shot 2016-09-20 at 6 54 23 am

Expected output:

It should align vertically and doesn't. Not sure how to write it, couldn't find docs for this.

cc @mdo

css v4

Most helpful comment

In general, I'm in support of easier vertical alignment of navbar contents :). I'll take a look soon.

All 9 comments

Can't say I understand why you'd want to mix button sizes within a navbar like this in the first place.

I wouldn't assume mixing as much as option to use smaller buttons in navbar instead of default ones for cosmetic reasons/or to fit more in case of apps.

Correct @rafalp exactly

Not to mention logos. The default navbar height is a bit small for a site logo.

In general, I'm in support of easier vertical alignment of navbar contents :). I'll take a look soon.

:+1: The docs also mentions ".navbar-nav for a full-height and lightweight navigation". I'm not sure what "full-height" is supposed to mean in this context.

Small example of using utilities to tweak this added in #19890.

My wish for being able to use a larger logo and have a vertically centered nav inside the same navbar does not seem covered by this. Should I open a separate issue?

@fuzzy76 For that, you're likely going to have to use custom styles to account for the larger image. In our default, non-flexbox version that's rather difficult to account for in a generic sense.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

iklementiev picture iklementiev  路  3Comments

kamov picture kamov  路  3Comments

eddywashere picture eddywashere  路  3Comments

devfrey picture devfrey  路  3Comments

ghost picture ghost  路  3Comments