【发布时间】:2016-08-08 13:31:24
【问题描述】:
我在移动设备中的 2 个页面没有达到 100% 的宽度,您可以看到它here。
我的代码中有<meta name="viewport" content="width=device-width" />,我尝试了它的各种变体。问题可能出在我的pages.phpfile 中,因为其余页面都是自定义模板?
这是我的 page.php 代码:
<?php
/**
* The template for displaying all pages.
*
* This is the template that displays all pages by default.
* Please note that this is the WordPress construct of pages
* and that other 'pages' on your WordPress site will use a
* different template.
*
*/
get_header(); ?>
<div id="primary" class="content-area">
<div id="content" class="site-content" role="main">
<?php while ( have_posts() ) : the_post(); ?>
<?php get_template_part( 'content' ); ?>
<?php endwhile; // end of the loop. ?>
</div><!-- #content .site-content -->
</div>
<?php get_footer(); ?>
CSS:
#content {
margin: 0 auto;
max-width: 51em;
background: none;
float: none;
margin: 0 auto;
padding: 0;
}
#primary {
width: 100%;
}
我不知道我是否遗漏了一些与 wordpress 相关的内容,或者弄乱了我的代码(我是编码的初学者),或者是什么。很困惑,因为我的其他页面工作正常,而且我在代码中看不到任何导致其宽度变窄的内容。
*btw - 尚未弄清楚移动设备中的导航,但您可以通过查看链接看到它在其他页面中有效: Home.
【问题讨论】: