为什么顶部标题位于导航菜单的顶部?

我创建了一个自定义的顶部标题,其CSS ID为“顶部标题”。但是,它显示在我的导航菜单上方,而不是下方。

我尝试将顶部标题的位置从“绝对”更改为“固定”,并将顶部像素从3px更改为300px,但没有任何改变。

编辑:我正在使用Divi建立网站。

我将以下代码输入到functions.php的底部:

function custom_header($ main_header){         $ custom_header。= do_shortcode('[et_pb_section global_module =“ 38561”] [/ et_pb_section]');     返回$ custom_header。 $ main_header; }

add_filter('et_html_main_header','custom_header');

有什么建议吗?

Photo of top-header on top of navigation menu

    #main-header {
  box-shadow: 0 0px 50px rgba(0,.1);
}
#main-header.et-fixed-header {
  box-shadow: 0 0px 25px rgba(0,.1) !important;
}
#top-header #et-info {
  position: absolute;
  top: 3px;
}
#et-info-phone:before,#et-info-email:before {
  margin-right: 8px;
  position: relative;
  top: 2px;
}
#et-secondary-menu {
  position: relative;
  top: 2px;
}
#et-secondary-menu a {
  font-size: 18px;
}
@media screen and (max-width : 600px) {
  #top-header #et-info {
    line-height: 1.5em;
  }
}



/*
/////////////////////////////////////////////////
NAVIGATION
/////////////////////////////////////////////////
*/

#main-header .nav li ul a {
  color: #000;
}
#main-header .nav li ul a:hover {
  background-color: transparent;
}
#top-menu .menu-item-has-children > a:first-child:after,#et-secondary-nav .menu-item-has-children > a:first-child:after {
  top: -2px;
}
li.sfly_social_media_menu_icon .fab {
  font-weight: 300;
}
#et_top_search {
  margin-top: 0;
}
#top-menu ul.sub-menu {
  width: 300px;
  box-shadow: 0 20px 80px rgba(0,.2);
}
#top-menu ul.sub-menu li {
  font-size: 12px;
  line-height: 1.2em;
}
#top-menu ul.sub-menu li a {
  width: 260px;
  padding: 15px 20px;
}
@media screen and (max-width : 980px) {
  .et_mobile_menu {
    background-color: rgba(0,.9);
    box-shadow: 0px 25px 50px 0px rgba(0,.25);
    text-align: center;
  }
  .et_mobile_menu li a {
    color: #fff !important;
    text-transform: uppercase;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 4px;
    padding: 15px 5%;
  }
  .et_mobile_menu li li {
    padding-left: 0;
  }
  .et_mobile_menu li li a {
    font-size: 18px;
    padding: 6px 5%;
  }
  .et_mobile_menu li li:last-child a {
    padding-bottom: 12px;
  }
  .et_mobile_menu li.sfly_social_media_menu_icon,.et_mobile_menu li.sfly_social_media_menu_icon a {
    display: inline-block;
  }
  .et_mobile_menu li.sfly_social_media_menu_icon a {
    padding: 25px 10px;
  }
}
@media screen and (max-width : 600px) {
  .et_mobile_menu li.sfly_social_media_menu_icon a {
    font-size: 20px;
  }
}
a85935935 回答:为什么顶部标题位于导航菜单的顶部?

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3140515.html

大家都在问