RSS提要显示 [英] RSS feed display

查看:161
本文介绍了RSS提要显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我为我的网站创建了一个新闻RSS源,但想要显示的格式类似于 http:/ /www.apple.com/hotnews/
如何将代码放到我的HTML页面上,它将从我的RSS中获取项目?

解决方案

您可以使用XSLT和CSS。



如果您不关心工作链接等,那么只需使用CSS。



例如,以下是我如何在我的某个网站上设置RSS订阅源的样式:

<$ p $频道链接,频道语言,频道版权,频道管理编辑,频道webMaster,频道文档,频道lastBuildDate,频道项目pubDate {display:none;}

rss {font- family:Arial,Helvetica,sans-serif;}

channel title {display:block;填充:1em的;颜色:#FFF; border-bottom:1px纯黑色;字体重量:粗体;字体大小:140%; background-color:#4483C7;}

channel description {display:block;向左飘浮;字体大小:130%; margin:1em;}

channel item {border:1px solid#4483c7; clear:both;显示:块;填充:0.5em; margin:1em;}

频道项目标题{background-color:#4483c7;边界底部宽度:0;颜色:#FFF;显示:块;字体大小:110%;字体重量:粗体;余量:0; padding:0.2em;}

频道项目描述{display:block;浮动:无;余量:0; text-align:left;填充:0.2em 0.5em 0.4em;颜色:黑色;字体大小:100%; font-weight:normal;}

频道项链接{color:#666;显示:块;字体大小:86%; padding:0 0.5em;}

结果如下: http://www.ourladyofgrace.com/Bulletins/olg_bulletins.xml



如果你想使页面工作,那么使用XSLT。



这里有一些信息。 http://www.paulwest.co.uk /article.php/styling-rss-news-feeds-with-xslt


I have created a news RSS feed for my website but want to display is in a format similar to http://www.apple.com/hotnews/ How would I put code onto my HTML page which would take the items from my RSS?

解决方案

You could use XSLT and CSS.

If you didn't care about links working, etc., then just use CSS.

For instance, here is how I style one of the RSS feeds on one of my sites:

channel link, channel language, channel copyright, channel managingEditor, channel webMaster, channel docs, channel lastBuildDate, channel item pubDate {display:none;}

rss {font-family:Arial, Helvetica, sans-serif;}

channel title {display:block; padding:1em; color:#FFF; border-bottom:1px solid black; font-weight:bold;font-size:140%; background-color:#4483C7;}

channel description {display:block; float:left; font-size:130%; margin:1em;}

channel item {border:1px solid #4483c7;clear:both; display:block; padding:0.5em; margin:1em;}

channel item title {background-color:#4483c7; border-bottom-width:0; color:#FFF; display:block; font-size:110%; font-weight:bold; margin:0; padding:0.2em;}

channel item description {display: block; float:none; margin:0; text-align: left; padding:0.2em 0.5em 0.4em; color: black; font-size:100%; font-weight:normal;}

channel item link {color:#666; display:block; font-size:86%; padding:0 0.5em;}

The result is this: http://www.ourladyofgrace.com/Bulletins/olg_bulletins.xml

If you want to make the page "work", then use XSLT.

Here's some info. http://www.paulwest.co.uk/article.php/styling-rss-news-feeds-with-xslt

这篇关于RSS提要显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆