我可以在页面上显示的所有图像上添加 <br> 标签吗?


Can I add <br> tag on all images that are displayed on the page?

这是我用来显示来自rss.php提要的内容的代码的一部分。

for($x=0;$x<$limit;$x++) {
    $title = str_replace(' & ', ' &amp; ', $feed[$x]['title']);
    $link = $feed[$x]['link'];
    $description = $feed[$x]['desc'];
    $date = date('l F d, Y', strtotime($feed[$x]['date']));
    echo '<p><strong><a href="'.$link.'" title="'.$title.'">'.$title.'</a></strong><br />';
    echo '<small><em>Posted on '.$date.'</em></small></p>';
    echo '<p><a style="color:#000;text-decoration:none;" href="'.$link.'" title="'.$title.'"></>'.$description.'</p>';

问题是.$description.包含图像+文本,而我以图像旁边的措辞结束。有什么方法可以在页面上显示的所有图像上添加<br>标签?我无法访问 rss.php。

试试这个

 $description = $feed[$x]['desc'];
 $description = str_replace("</img>","</img><br/>",$description);

Feed 描述中添加如下所示的 css 类:

添加到页面 CSS:

.feedItem img {
    clear: right;
    display: block;
} 

并将class="feedItem"添加到p标签:

echo '<p class="feedItem"><a style="color:#000;text-decoration:none;" href="'.$link.'" title="'.$title.'"></>'.$description.'</p>';