沉冰浮水

沉冰浮水

做最终到的事,成为最终成为的人!
github
bilibili
mastodon
zhihu
douban

"Waterhole" Z-Blog Simple Secondary Navigation Menu CSS

Due to historical reasons, the navigation and friend link management of Z-Blog are relatively complex. Although it is planned to be modified at the system level in the future, as a transition, it is recommended to use plugins:

Link Module Management - Z-Blog App Center:

https://app.zblogcn.com/?id=1873

The plugin currently supports secondary navigation, but the front-end effect needs to be adapted by the theme itself.

The following code is applicable to the default theme and is expected to be directly built-in shortly after this article is published.

#divNavBar li {
  position: relative;
}
#divNavBar li ul {
  display: none;
  position: absolute;
  left: 0;
  white-space: nowrap;
  /* ↓↓ Generally set to the same height as #divNavBar */
  top: 36px;
  /* ↓↓ The background color should be based on the actual situation */
  background-color: #297bc4;
}
#divNavBar li:hover ul {
  display: block;
}

For responsive themes, there are various considerations for the mobile site effect.

Themes built using front-end frameworks like Bootstrap can also use their navigation components. The link management plugin supports custom templates, which can directly generate the required HTML structure and is not limited to the form of ul->li>(a+ul>li>a).

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.