RSS image 元素
定義和用法
<image> 元素指定一個圖片,用以與頻道一起顯示。
提示和註釋
注意:該圖片必須是GIF、JPEG或PNG類型。
<image> 元素的子元素
標籤 | 描述 |
---|---|
<description> | 可選。 規定圖片鏈接的HTML 標題屬性中的文本。 |
<height> | 可選。 定義圖像的高度。 默認是31。 最大值是400。 |
<link> | 必需。 定義提供該頻道的網站的超連接。 |
<title> | 必需。 定義當圖片不能顯示時所顯示的替代文本。 |
<url> | 必需。 定義圖像的URL。 |
<width> | 可選。 定義圖像的寬度。 默認是88。 最大值是144。 |
實例
<?xml version="1.0" encoding="ISO-8859-1" ?>
<rss version="2.0">
<channel>
<title>W3CSchool Home Page</title>
<link>http://www.w3cschool.cc</link>
<description>Free web building tutorials</description>
<image>
<url>http://www.w3cschool.cc/images/logo.gif</url>
<title>W3CSchool.com</title>
<link>http://www.w3cschool.cc</link>
</image>
<item>
<title>RSS Tutorial</title>
<link>http://www.w3cschool.cc/rss</link>
<description>New RSS tutorial on W3CSchool</description>
</item>
</channel>
</rss>
<rss version="2.0">
<channel>
<title>W3CSchool Home Page</title>
<link>http://www.w3cschool.cc</link>
<description>Free web building tutorials</description>
<image>
<url>http://www.w3cschool.cc/images/logo.gif</url>
<title>W3CSchool.com</title>
<link>http://www.w3cschool.cc</link>
</image>
<item>
<title>RSS Tutorial</title>
<link>http://www.w3cschool.cc/rss</link>
<description>New RSS tutorial on W3CSchool</description>
</item>
</channel>
</rss>
嘗試一下»
完整RSS參考手冊