R
R
Randewoo2019-11-13 14:34:21
UIkit
Randewoo, 2019-11-13 14:34:21

How to make navbar smaller?

In the standard navbar, the height is 80px, is it possible to somehow reduce this height with the condition that the text will also remain centered? I tried to reduce it, I succeeded, but the text, in turn, went higher.
5dcbea3b31765631086669.png

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Andrew, 2019-11-13
@Randewoo

What exactly is the difficulty?

.uk-navbar-nav>li>a {
    min-height: 40px; /* уменьшили высоту */
}

or for all at once
.uk-navbar-item, .uk-navbar-nav>li>a, .uk-navbar-toggle {
   min-height: 40px; 
}

It's enough. when the styles are connected in the correct order

I
ildar-meyker, 2019-11-13
@ildar-meyker

While we are waiting for Andrei, I can answer.
Yes, you can. But it is necessary to share the code, because such a menu can be assembled in several ways.

R
Randewoo, 2019-11-13
@Randewoo

Answer found.
It turns out that UIKit is poor, you need to shove !important everywhere in it if you want to change the style for yourself. What for?
Thanks for the answer, as always, Andrew ;)

.uk-navbar-nav > li > a,
.uk-navbar-item,
.uk-navbar-toggle {
  min-height: 50px !important;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question