标头右对齐,而不是在移动屏幕上居中

时间:2019-09-02 20:23:35

标签: css responsive-design

当我用chrome扩展缩放浏览器窗口时,标题似乎很好,但是在我的手机上,看起来像这样:

https://www.imagefruit.com/tn/i38933/2019-09-02-20.40.58.png?id=03ecad34ca63c31f343533393937

(它的右对齐而不是居中)

在带移动秤的桌面上,看来:

https://i.ibb.co/9bJJZvt/Ads-z.png

<style>


    @media screen and (max-width:900px) ,screen and (max-device-width:900px) {

  .cep{ 
      margin-left: auto;
  margin-right: auto;
       text-align: center;
        }



}

</style>



<nav class="navbar navbar-expand-md navbar-light  sticky-top" style="background-color:#F3F3F3;" role="navigation">
  <div class="container cep" >

    <!-- Brand and toggle get grouped for better mobile display -->

    <a class="navbar-brand"  > 




      </a>
  <?php $custom_logo_id = get_theme_mod( 'custom_logo' );
$custom_logo_url = wp_get_attachment_image_url( $custom_logo_id , 'full' );
echo '<img src="' . esc_url( $custom_logo_url ) . '" class="img-fluid" alt="Responsive image" style="max-height: 75px;
  max-width: 90px; padding-right:10px;">'; ?>



           <h2><a href="www.deniz-tasarim.site" style="color:white;">
<?php

$site_title = get_bloginfo( 'name' );




echo '' . $site_title;

?>
      </a></h2>



      <div class="mobile-navbar-menu-if" style="margin:auto;">
          <?php
          wp_nav_menu( array(
                  'menu'              => 'primary',
                  'theme_location'    => 'primary',
                  'depth'             => 2,
                  'container'         => 'div',
                  'container_class'   => 'collapse navbar-collapse',
                  'container_id'      => 'bs-example-navbar-collapse-1',
                  'menu_class'        => 'nav navbar-nav',
                  'fallback_cb'       => 'wp_bootstrap_navwalker::fallback',
                  'walker'            => new wp_bootstrap_navwalker())
          );
          ?>


      </div>
      <div>

          <?php if ( function_exists( 'hfe_render_header' ) ) { hfe_render_header(); } ?>
      </div>


    </div>
</nav>

0 个答案:

没有答案