html - Fixed positioned header persists on desktop but not on mobile? -
if narrow browser see .header-mobile
element. fixed positioned. , persists on desktop on mobile it's left on top.
this mobile css:
@media handheld, screen , (max-width: 767px) { #header, #header-fixed { display: none; } #header-mobile { background: url(images/header-fixed-bg.png) repeat-x 0 0; border-bottom: 1px solid #111; display: block; position: fixed; top: 0; width: 100%; -webkit-box-shadow: rgba(0,0,0,0.3) 0 0 4px; -moz-box-shadow: rgba(0,0,0,0.3) 0 0 4px; box-shadow: rgba(0,0,0,0.3) 0 0 4px; }
the html:
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> </header> <div id="header-mobile"> <div id="header-mobile-content"> <h1 class="logo"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home">test</a></h1> <a class="button button-small" href=""> <img src="<?php bloginfo( 'template_url' ); ?>/images/icon-button.png" alt="" /> <span>request quote</span> </a> <ul class="navigation-mobile"> <li> <a class="responsive" href="#responsive"> <span>responsive design</span> </a> </li> <li> <a class="touch" href="#touch"> <span>touch friendly</span> </a> </li> <li> <a class="programming" href="#programming"> <span>custom programming</span> </a> </li> <li> <a class="mobile" href="#mobile"> <span>mobile/site apps</span> </a> </li> </ul> </div> </div>
live site: http://www.hfwebdesign.com/?modpagespeed=off
what reason?
i'm not sure why, had add this:
<meta content='width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no' name='viewport'>
Comments
Post a Comment