[英]HTML5 wordpress theme on WebKit goes crazy?
當我發現此錯誤時,我正在測試WP HTML5主題。 整個內容降低了大約19像素,當我打開源代碼時,放置在編輯器中head標簽之間的代碼在chrome源代碼中的body標簽之間。 這僅在Webkit瀏覽器(Chrome和Opera)上顯示,而在Firefox上很好。
我嘗試使用以下方法修復此錯誤:
-webkit-margin-before: -16px;
但這不適用於WP主題中的頁面模板,因為在Chrome上運行任何Wordpress頁面示例時都沒有錯誤。 我試圖將代碼從頁面模板(page.php)復制到文章模板(single.php),並且知道它們在相同的代碼上運行,但是外觀有所不同(請看屏幕截圖)。
兩種模板的代碼(page.html和single.html):
<?php
get_header();
if (have_posts()):
while (have_posts()) : the_post(); ?>
<article class="postWrapper" id="post-<?php the_ID(); ?>">
<div class="thumb">
<?php
the_post_thumbnail();
?>
</div>
<div class="post-text">
<p class="category">
<?php the_category(' » '); ?>
</p>
<h2 class="article-title postTitle">
<a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_excerpt(); ?>">
<?php the_title(); ?>
</a>
</h2>
<p class="details">
<?php the_date(); ?> Autor: <strong><?php the_author_link(); ?></strong>, <?php comments_popup_link(__('Nema komentara'), __('1 komentar'), __('% komentara')) . edit_post_link(__('Izmeni'), ' | '); ?>
</p>
<div class="text">
<?php the_content(__('Pročitaj više...')); ?>
</div>
</div>
</article>
<?php endwhile; else: ?>
<p><?php _e('Žao nam je, nismo ništa pronašli što vas interesuje. :('); ?></p>
<?php
endif;
?>
</div>
<?php
get_sidebar(); ?>
</div>
<?php
get_footer();
?>
問題是關於在Notepad ++中進行編碼,我使用了UTF-8,但是當我打開沒有BOM的UTF-8時,問題就消失了。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.