How to adjust the height of the top navigation bar and banner

סיכום מבוסס בינה מלאכותית

用户 祁同伟 询问如何调整顶部导航栏和横幅的高度,认为它们相对于徽标、头像和文字显得过高。NateDhaliwal 表示可以通过CSS调整,并询问具体原因。祁同伟 确认了需要调整的部分。ToddZ 提供了调整顶部导航栏和横幅高度的CSS代码,并进一步解释了如何调整全局通知横幅的内边距。

You can’t do this normally, but can do so with CSS, but it really depends on what height you want. May I ask, what is the reason for this? Thanks.

The top navigation bar is too tall relative to the logo and avatar.

The banner height is also a bit too tall relative to the text height.

Could you provide me with the CSS code to modify these, if possible?

Hi there, which banner are you referring to? Thanks.

I’ll take a guess is that “banner” means the header bar:
image

…which you should be able to change like this (choose your own height and units):

header.d-header {
  height: 50px;
}

And maybe “top navigation bar” is the topic menu:
image

…which you can change like this:

section.navigation-container {
  height: 40px;
}

Global Notice

If you inspect the global notice banner with browser devtools, you can see the div has an id and some classes:

image

It normally gets the padding, which affects the banner size, from the .alert class:

But you can override that just for the Global Notice, like this:

#global-notice-alert-global-notice {
  padding: .2em .5em .2em .5em;
}

image