2017-03-08 79 views
0

我正在基于CMS WordPress的学校项目(餐厅网站),但我有一个问题的标题,有一些溢出约20-19px,我不知道如何修理它。标题溢出约20px

我无法为标题设置固定大小,因为导航菜单无法正常工作,min-height也无法正常工作。

有人可以帮我解决这个问题吗?我没有太多的时间来完成这个项目,我还有很多工作要做:)的网址是http://restaurant.g6.cz/menu/

Image shows the problem here //

header .heading { 
     display: block; 
     width: 100%; 
     height: 300px;  
     background-repeat: no-repeat;} 


    .slider{ 
     display: block; 
     width: 100%; 
     height: 300px;  
     position: absolute; 
    } 

     /*Horizontal menu*/ 

    header nav{ 
     width: 100%; 
     background-color: #232323; 
     display: table; 

    } 

    header nav ul{ 
     background-color: #232323; 
     overflow:hidden; 
     color:white; 
     padding:0px; 
     text-align:center; 
     list-style-type: none; 
     margin:0px; 
     transition: max-height 0.4s; 
     -webkit-transition: max-height 0.4s; 
     -ms-transition: max-height 0.4s; 
     -moz-transition: max-height 0.4s; 
     -o-transition: max-height 0.4s; 
    } 

    header nav ul li{ 
     display:table-cell; 
     padding: 15px 0px 15px 0px; 
     border-right: 1px; 
     border-right-style:solid; 
     border-right-color: #333333; 
     vertical-align: middle; 
     font-weight: bold; 


     } 

    header nav ul li a{ 
     font-size: 100%; 
     text-decoration: none; 
     color: white; 
     padding: 15px 20px 16px 20px; 
    } 

    header nav ul li:hover{ 
    background-color: #171717; 
    } 

    header nav ul li a:hover { 
    color: #DDAF4D; 
    } 

    header nav ul li.current-menu-item { 
    background: #171717; 
    } 

    header nav ul li.current-menu-item a { 
    color: #DDAF4D; 
    } 


    .menupozmenseni { 
    width: 100%; 
    background-color: #171717; 
    text-align:left; 
    box-sizing: border-box; 
    /*padding: 15px 10px; */ 
    height: 49px; 
    cursor: pointer; 
    color: white; 
    display:none; 
    background-image:url(obrazky/menu.png); 
    background-repeat:no-repeat; 
    background-position: center; 
    } 

    @media screen and (max-width: 968px) { 

    header nav ul{ 
     max-height: 0px; 
    } 

    header nav ul li { 
    box-sizing:border-box; 
    width: 100%; 
    padding: 0px; 
    display:block; 
    } 

    header nav ul li a{ 
    display:block; 
    margin: 0px; 
    padding: 15px 0px 16px 0px; 
    } 

    .menupozmenseni{ 
     display:block; 

     } 

    .skryteprvkymenu{ 
     max-height: 450px; 
     -webkit-transition: max-height 0.8s; 
     -ms-transition: max-height 0.8s; 
     -moz-transition: max-height 0.8s; 
     -o-transition: max-height 0.8s; 
     } 


    } 
    </style> 





    <header> 


     <div class="heading"> 
       <div class="slider"> 

     <?php if (is_page($page = 'menu')){ ?> 
     <?php echo do_shortcode('[smartslider3 slider=6]'); ?> 

     <?php } elseif (is_page($page = 'vinny-listek')){ ?> 
     <?php echo do_shortcode('[smartslider3 slider=7]'); ?> 

     <?php }else{ ?> 
     <?php echo do_shortcode('[smartslider3 slider=5]'); ?> 

     <?php } ?> 

     </div> 
     <div class="site-branding"> 
       <?php if (is_front_page() || is_home()) : ?> 
        <div class="site-title"><a href="<?php echo esc_url(home_url('/')); ?>" rel="home"><?php bloginfo('name'); ?></a></div> 
       <?php else : ?> 
        <div class="site-title"><a href="<?php echo esc_url(home_url('/')); ?>" rel="home"><?php bloginfo('name'); ?></a></div> 
       <?php endif; 

       $description = get_bloginfo('description', 'display'); 
       if ($description || is_customize_preview()) : ?> 
        <div class="site-description"><?php echo $description; ?></div> 
       <?php endif; ?> 
      </div> 

     <div class="nadpis"> 
     <a href="<?php the_permalink();?>"><?php the_title();?></a> 
     </div> 


     </div> 

     <nav class="site-nav"> 

      <?php 

      $args = array(
       "theme_location" => "primary" 
      ); 

      ?> 

      <?php 
       wp_nav_menu($args); 
      ?> 

    <div class="menupozmenseni"></div>  

     </nav> 

    <script> 
    $(".menupozmenseni").on("click", function() { 
     $("header nav ul").toggleClass("skryteprvkymenu"); 
    }); 
</script> 

    </header> 
+0

你能否提供你的代码? –

+0

如果你通过检查员看你的元素,在关闭标题标记之前,你的脚本标记后面有一些看不见的编码字符,这个看不见的字符正在创建空白区域 – PhilS

+0

Sweta Parmar:如果你真的想要我可以,我在这里把一个链接:) PhilS:你说得对,我现在可以看到它,它在那里,因为网站是响应式的,当你调整浏览器窗口大小时,你可以看到隐藏的元素。我怎样才能做到这一点,没有空的空间? :) –

回答

0

如果你看到检查员,在你的头部,你会发现这个字符串"&#65279"。看看截图,看看你自己。这是什么导致额外的空白,删除,你很好! screenshot

+1

谢谢:)它不是在PSPad中可见的,但我下载了Adobe Dreamweaver试用版,它在那里可见像小红点,所以我删除了这一点,它解决了我的问题,但也许每个人都可以解决这个问题时保存UTF -8文件没有BOM :) –