【问题标题】:CSS to align image for each rss feed from external siteCSS 为来自外部站点的每个 RSS 提要对齐图像
【发布时间】:2012-09-07 17:43:06
【问题描述】:

如何才能在每个新闻提要的左上角正确对齐缩略图?

这是每个项目的提要的代码,我无法更改下面的格式,因为它是来自外部站点的 rss 提要

<style>
img{
    float: left;
    width: 100px;
    height: auto;       
}
.feed-item-title{
    clear:right;
 }
</style>


<div class="feed-item">
<h3 class="feed-item-title">
    <a href="" target="_blank">Rihanna Hug During VMA Show</a>
</h3>

<div class="feed-item-body">
    Former couple share embrace on night when both won major awards.<br />By Hosten
    <a href="">
    <img type="photo" src="281x211.jpg" />
    </a>
    <br />
</div>

</div>

非常感谢。

【问题讨论】:

    标签: css image css-float


    【解决方案1】:

    如果你使用浮动,你应该清除它们。

    .feed-item-body:after{
        content: '';
        display:block;
        clear:both;
    }
    

    稍后编辑:添加了一些额外的更改,here 是工作示例。

    【讨论】:

    • 谢谢,通过这种方式,rss 缩略图和标题将在每个项目的提要中自上而下而不是从左向右显示。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-11-07
    • 2015-04-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-03-09
    相关资源
    最近更新 更多