带搜索栏的AMP导航

时间:2018-08-09 12:40:26

标签: css amp-html searchbar

我正在尝试在标头中实现搜索栏,例如:https://ampbyexample.com/samples_templates/product_browse_page/#header-with-search

当我尝试将其实现到我的header-bar.php中时,它看起来很奇怪: enter image description here 这是我的代码,没有搜索。我该如何证明这一权利?

html {
     background: white;
    }
    .headerbar {
    top: 0;
        background: #212a49;
        position: fixed;
        width: 100%;
        z-index: 1;
    }
    .hamburger {
      padding: 8px;
    color:white;
    }      
 
    <head>
        <script async custom-element="amp-sidebar" src="https://cdn.ampproject.org/v0/amp-sidebar-0.1.js"></script>
        	<script async custom-element="amp-social-share" src="https://cdn.ampproject.org/v0/amp-social-share-0.1.js"></script>
        	<script async custom-element="amp-carousel" src="https://cdn.ampproject.org/v0/amp-carousel-0.1.js"></script>
          <style amp-boilerplate>body{-webkit-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-moz-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-ms-animation:-amp-start 8s steps(1,end) 0s 1 normal both;animation:-amp-start 8s steps(1,end) 0s 1 normal both}@-webkit-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-moz-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-ms-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-o-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}</style><noscript><style amp-boilerplate>body{-webkit-animation:none;-moz-animation:none;-ms-animation:none;animation:none}</style></noscript>
       <script async src="https://cdn.ampproject.org/v0.js"></script>
        </head>


            <header class="headerbar" id="top">
                  <div role="button" on="tap:sidebar1.toggle" tabindex="0" class="hamburger">☰</div>
                </header>
                <amp-sidebar id="sidebar1" layout="nodisplay" side="left">
                  <div role="button" aria-label="close sidebar" on="tap:sidebar1.toggle" tabindex="0" class="close-sidebar">✕</div>
                  <ul class="sidebar">
                    <li><a href="https://www.test.de">Startseite</a></li>
                    <li><a href="https://www.test.de/blog">Blog</a></li>
                	<li><a href="https://www.test.de/infografiken">Infografiken</a></li>
                    <li><a href="https://www.test.de/ergonomie-shop">Ergonomie-Shop</a></li>
                	<li><a href="https://www.test.de/kontakt">Kontakt</a></li>
                  </ul>
                </amp-sidebar>

0 个答案:

没有答案