2017-04-20 187 views
0

首先,我使用this responsive template來創建網站。 當您向下滾動到頁腳時,頂部的導航欄位於內容之上,因此您可以始終查看導航欄。但是,當您到達頁腳時,頁腳僅覆蓋導航欄。看起來,z-index屬性不起作用。此錯誤僅在Safari中。當你的分辨率像移動分辨率(人像)時,你可以重現它。z-index不適用於safari

[只有Safari],那並不出現在Chrome或Firefox

我真的不知道該怎麼辦這個錯誤,我已經嘗試了一些東西,這didnt解決問題。

請幫助:) THX

編輯:

導航欄作爲遵循的index.html

<!-- PAGE --> 
<div id="page"> 

    <!-- HEADER --> 
    <header> 

     <!-- MENU BLOCK --> 
     <div class="menu_block"> 

      <!-- CONTAINER --> 
      <div class="container clearfix"> 

       <!-- LOGO --> 
       <div class="logo pull-left"> 
        <a href="index.html" ><span class="b1">w</span><span class="b2">h</span><span class="b3">i</span><span class="b4">t</span><span class="b5">e</span></a> 
       </div><!-- //LOGO --> 

       <!-- SEARCH FORM --> 
       <div id="search-form" class="pull-right"> 
        <form method="get" action="#"> 
         <input type="text" name="Search" value="Search" onFocus="if (this.value == 'Search') this.value = '';" onBlur="if (this.value == '') this.value = 'Search';" /> 
        </form> 
       </div><!-- SEARCH FORM --> 

       <!-- MENU --> 
       <div class="pull-right"> 
        <nav class="navmenu center"> 
         <ul> 
          <li class="first active scroll_btn"><a href="#home" >Home</a></li> 
          <li class="scroll_btn"><a href="#about" >About Us</a></li> 
          <li class="scroll_btn"><a href="#projects" >Projects</a></li> 
          <li class="scroll_btn"><a href="#team" >Team</a></li> 
          <li class="scroll_btn"><a href="#news" >News</a></li> 
          <li class="scroll_btn last"><a href="#contacts" >Contacts</a></li> 
          <li class="sub-menu"> 
           <a href="javascript:void(0);" >Pages</a> 
           <ul> 
            <li><a href="blog.html" >Blog</a></li> 
            <li><a href="blog-post.html" >Blog Post</a></li> 
            <li><a href="portfolio-post.html" >Portfolio Single Work</a></li> 
           </ul> 
          </li> 
         </ul> 
        </nav> 
       </div><!-- //MENU --> 
      </div><!-- //MENU BLOCK --> 
     </div><!-- //CONTAINER --> 
    </header><!-- //HEADER --> 

頁腳是index.html中實現實施

<!-- FOOTER --> 
<footer> 

    <!-- CONTAINER --> 
    <div class="container"> 

     <!-- ROW --> 
     <div class="row" data-appear-top-offset="-200" data-animated="fadeInUp"> 

      <div class="col-lg-4 col-md-4 col-sm-6 padbot30"> 
       <h4><b>Featured</b> posts</h4> 
       <div class="recent_posts_small clearfix"> 
        <div class="post_item_img_small"> 
         <img src="images/blog/1.jpg" alt="" /> 
        </div> 
        <div class="post_item_content_small"> 
         <a class="title" href="blog.html" >As we have developed a unique layout template</a> 
         <ul class="post_item_inf_small"> 
          <li>10 January 2014</li> 
         </ul> 
        </div> 
       </div> 
       <div class="recent_posts_small clearfix"> 
        <div class="post_item_img_small"> 
         <img src="images/blog/2.jpg" alt="" /> 
        </div> 
        <div class="post_item_content_small"> 
         <a class="title" href="blog.html" >How much is to develop a design for the game?</a> 
         <ul class="post_item_inf_small"> 
          <li>14 January 2014</li> 
         </ul> 
        </div> 
       </div> 
       <div class="recent_posts_small clearfix"> 
        <div class="post_item_img_small"> 
         <img src="images/blog/3.jpg" alt="" /> 
        </div> 
        <div class="post_item_content_small"> 
         <a class="title" href="blog.html" >How to pump designer</a> 
         <ul class="post_item_inf_small"> 
          <li>21 December 2013</li> 
         </ul> 
        </div> 
       </div> 
      </div> 

      <div class="col-lg-4 col-md-4 col-sm-6 padbot30 foot_about_block"> 
       <h4><b>About</b> us</h4> 
       <p>We value people over profits, quality over quantity, and keeping it real. As such, we deliver an unmatched working relationship with our clients.</p> 
       <p>Our team is intentionally small, eclectic, and skilled; with our in-house expertise, we provide sharp and</p> 
       <ul class="social"> 
        <li><a href="javascript:void(0);" ><i class="fa fa-twitter"></i></a></li> 
        <li><a href="javascript:void(0);" ><i class="fa fa-facebook"></i></a></li> 
        <li><a href="javascript:void(0);" ><i class="fa fa-google-plus"></i></a></li> 
        <li><a href="javascript:void(0);" ><i class="fa fa-pinterest-square"></i></a></li> 
        <li><a href="javascript:void(0);" ><i class="map_show fa fa-map-marker"></i></a></li> 
       </ul> 
      </div> 

      <div class="respond_clear"></div> 

      <div class="col-lg-4 col-md-4 padbot30"> 
       <h4><b>Contacts</b> Us</h4> 

       <!-- CONTACT FORM --> 
       <div class="span9 contact_form"> 
        <div id="note"></div> 
        <div id="fields"> 
         <form id="contact-form-face" class="clearfix" action="#"> 
          <input type="text" name="name" value="Name" onFocus="if (this.value == 'Name') this.value = '';" onBlur="if (this.value == '') this.value = 'Name';" /> 
          <textarea name="message" onFocus="if (this.value == 'Message') this.value = '';" onBlur="if (this.value == '') this.value = 'Message';">Message</textarea> 
          <input class="contact_btn" type="submit" value="Send message" /> 
         </form> 
        </div> 
       </div><!-- //CONTACT FORM --> 
      </div> 
     </div><!-- //ROW --> 
    </div><!-- //CONTAINER --> 
</footer><!-- //FOOTER --> 

style.css實現元素的以下樣式:

頁腳:

footer { 
    overflow:hidden; 
    position:fixed; 
    bottom:0; 
    left:50%; 
    opacity:0; 
    width:100%; 
    padding:60px 0 10px; 
    color:#999; 
    background-color: #1c1c1c; 
    transform: translateX(-50%); 
    -ms-transform: translateX(-50%); 
    -webkit-transform: translateX(-50%); 
    z-index:1; 
} 

Menu_block:

.menu_block { 
    position: fixed; 
    z-index:9999; 
    left:0; 
    top:0; 
    right:0; 
    height:80px; 
    width:100%; 
    background-color:#fff; 
    box-shadow:0 2px 3px rgba(0,0,0,0.1); 
} 
+2

[我的網站上的某些東西無法正常工作,我可以直接粘貼一個鏈接嗎?](https://meta.stackoverflow.com/questions/254428/something-in-my-web-site-or- project-doesnt-work-can-i-just-paste-a-link-to-it)否,請創建一個[MCVE] – Pete

+0

添加一些信息。希望它有幫助 – Jones

回答

0

消失,因爲你在你的風格分集#slideboxdisplay: none;。只需刪除display: none;

+0

你是什麼意思?我沒有找到「#slidebox」...請給我一些更多的信息 – Jones

+0

我無法想象你的文章是解決方案,但我真的很想簡單地嘗試它。請給我更多信息,例如代碼行,文件名等。 – Jones

+0

@Jones sry認爲您發佈的鏈接是您的網站。真的很抱歉。我剛剛意識到它的模板下載。 –

0

您是否嘗試過在導航欄和頁腳上使用z-index?它應該在每個瀏覽器中正常執行業務。

確保頁腳的值始終低於導航欄。

+0

是的,我嘗試過。我用一些代碼編輯了這篇文章。它適用於Firefox和Chrome,但不適用於Safari – Jones

+0

另一個想法是什麼? – Jones

相關問題