0
私はポストタイトルをループしてページ上部の特別な最新ニュースセクションに最初の6文字を表示するループをwordpressに書いています。問題は、私があなたがイメージで見ることができるように見出しを近づけることができないということです[2]。私は、画像に示すように、これらのタイトルを表示したい[1] [1]:http://i.stack.imgur.com/igNOe.png [2]:http://i.stack.imgur.com/92DW7.pngdivに文字を近づける
相続人は私のHTMLとPHPコード:
<div id="freshlyWrapper">
<div id="freshlyposts">
<?php
$freshlyIonised = new WP_Query();
$freshlyIonised->query('category_name=featured&showposts=6');
while($freshlyIonised->have_posts()):
$freshlyIonised->the_post();
?>
<div class="freshlyionisedbox"><h3><?php the_title(); ?></h3></div>
<?php endwhile; ?>
そして相続人のcss
#freshlyWrapper {
width: 980px;
text-align: left;
background: #ffffff;
float:left;
}
#freshlyposts {
width:980px;
margin: 0 auto;
text-align: left;
height: 100px;
color: #000000;
}
.freshlyionisedbox {
position: relative;
float:left;
height: 25px;
margin-left: 140px;
padding:0px;
top: 3px;
}
#freshlyposts h3 {
width:auto;
font-weight: normal;
letter-spacing: normal;
font-family:Georgia, "Times New Roman", Times, serif;
font-size:13px;
}
.clearboth { clear:both; }
@hackre:あなたの回答を編集していただきありがとうございます; –
@hakre:回答が投稿された直後に編集しないでください。回答者はしばしば5分間の猶予期間内に回答者を編集します。 – thirtydot
私はこれを2時間解決しようとしていましたが、これは簡単でした。ありがとうアーサーハルマ! –