2017-03-08 89 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 :) –