天气网站提供的代码,不过比较好的是可以定制你自己的城市,而且有三种样式可供你选择,网址:http://www.tianqi123.com/main/small_page.html

如果您会HTML语言,您还可以在iframe代码中的url后面加参数,如:
chengshi_321.html?c0=F9DC68&c1=white&c2=FEFCE0&t1=red&bg=white&w=160&h=250&text=no
 
其中 c0 表示表格第一行背景颜色;c1、c2表示表格其他行间隔的背景颜色;t1表示标题颜色;bg 表示页面背景颜色;w 表示表格宽度, h 表示表格高度 
 
当 text=yes 时,将会出现滚动的天气文字,建议您自己调试看看,如:
chengshi_321.html??c0=red&c1=FF9900&bg=F4FFF4&w=160&h=20&text=yes
 
注意:颜色请不要加 # 符号,如 #FF9900 请写成 FF9900

 

 

 

<iframe src="http://www.tianqi123.com/small_page/chengshi_1.html" width=160 height=248 marginwidth=0 marginheight=0 hspace=0 vspace=0 frameborder=0 scrolling=no align=center id=url></iframe>

 

<iframe src="http://www.tianqi123.com/small_page/chengshi_1.html?c0=F9DC68&c1=white&c2=FEFCE0&t1=red&bg=white&w=160&text=no" width=160 height=248 marginwidth=0 marginheight=0 hspace=0 vspace=0 frameborder=0 scrolling=no align=center id=url></iframe>

 

<iframe src="http://www.tianqi123.com/small_page/chengshi_1.html?c0=red&c1=FF9900&bg=F4FFF4&w=160&h=20&text=yes" width=160 height=21 marginwidth=0 marginheight=0 hspace=0 vspace=0 frameborder=0 scrolling=no align=center id=url></iframe>

 

 

 

透明背景

这个方法那个天气预报网站上没有提供,就是如何把天气预报的背景全部弄透明,同上参数说明,如:
chengshi_1.html?c0=F9DC68&c1=white&c2=FEFCE0&t1=red&bg=white&w=160&h=250&text=no

其中c0 表示表格第一行背景颜色;c1、c2表示表格其他行间隔的背景颜色;t1表示标题颜色;bg 表示页面背景颜色

这里我们把颜色全部改为:transparent,然后在原代码中加上这段参数:allowTransparency=true,比如说这段代码:

 

<iframe src=http://www.tianqi123.com/small_page/chengshi_1.html?c0=transparent&c1=transparent&c2=transparent&t1=transparent&bg=transparent&w=160&text=no width=160 height=248 marginwidth=0 marginheight=0 hspace=0 vspace=0 frameborder=0 scrolling=no align=center id=url allowTransparency=true></iframe>

 




posted on 2009-04-20 09:58  Sunshine08  阅读(720)  评论(0编辑  收藏  举报