2016-05-15 5 views
0

私は自分のwordpressループで次のリターンを取り除こうとします。私は、次のエントリにサムネイルを表示すると、それはひどい見えます:どうすればそこに帰ることができますか?

the situation

私はエントリのパディングを使用しようとしたが、それは悪いことです!ここで

は私のコードです:

#thumbnail_single { 
 
    float: left; 
 
} 
 
.entry_single { 
 
    padding: 20px; 
 
}
<div id="single"> 
 

 
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?> 
 
    <h2 class="title_single"><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h2> 
 

 
    <div id="thumbnail_single"> 
 

 
    <?php if (has_post_thumbnail()) : ?> 
 
    <?php the_post_thumbnail(); ?> 
 
    </a> 
 
    <?php endif; ?> 
 

 
    </div> 
 
    <div class="entry_single"> 
 
    <?php the_content(); ?> 
 
    </div> 
 
    <?php endwhile; endif; ?> 
 

 
</div> 
 
<!-- single -->

はそれであなたの助けをありがとう!

+0

.entry_singleを折り返しずにそのままにし、オーバーフローを追加するにはmargin-right to imageを設定する必要があります.entry_singleにhidden、paddingも適用されます –

答えて

1

あなた#thumbnail_singleに20ピクセルのパディングを追加してみてくださいだけでなく

私には完全には明らかではない
2

、最終的な結果に応じて、2つのオプション:

wrapingテキスト:

#thumbnail_single { 
    float: left; 
    margin-right:20px; 
} 
.entry_single { 

} 

テキストは下のラッピング不可:

BFC:http://www.sitepoint.com/understanding-block-formatting-contexts-in-css/

#thumbnail_single { 
    float: left; 
} 
.entry_single { 
    padding: 20px; 
    overflow:hidden; 
} 
関連する問題