- UID
- 434043
- 在线时间
- 465 小时
- 积分
- 4824
- 帖子
- 723
- 精华
- 0
- 专家
- 0
- 居住地
- 江西省 南昌市
- 离线
- 289 天
- 注册时间
- 2008-2-16
- 帖子
- 723
- 威望
- 11
- 居住地
- 江西省 南昌市
- 注册时间
- 2008-2-16
|
发表于 2008-3-31 19:40:51
|显示全部楼层
这是网页的 WAP静态的谁会
加入以下HTML代码在你的网站上显示标准北京时间:
提供iframe格式和javascript两种格式,iframe格式的好处是对你的网页速度没有影响,即使本站服务器忙碌的时候。
而有的博客不支持iframe,这时候可以选用javascript格式。
显示日期、星期、时钟:
<iframe src="http://s.time.org.cn/clock/#color:ff0000;font-size:9pt" width=200 height=20 frameborder=0 scrolling=no allowTransparency=true></iframe>
显示示例: 2006年6月6日 星期二 11:06:06
显示日期和星期:
<iframe src="http://s.time.org.cn/date/#color:ff0000;font-size:9pt" width=150 height=20 frameborder=0 scrolling=no allowTransparency=true></iframe>
显示示例: 2006年6月6日 星期二
只显示日期:
<iframe src="http://s.time.org.cn/day/#color:ff0000;font-size:9pt" width=108 height=20 frameborder=0 scrolling=no allowTransparency=true></iframe>
显示示例: 2006年6月6日
只显示时钟:
<iframe src="http://s.time.org.cn/now/#color:ff0000;font-size:9pt" width=70 height=20 frameborder=0 scrolling=no allowTransparency=true></iframe>
显示示例: 11:06:06
你可以控制以上代码的显示格式:
color-字体颜色,修改代码中的ff0000为你想要的颜色
font-size-字体大小,修改代码中的9pt为你想要的大小
width-显示区的宽度,字体越大,该数值应该越大
height-显示区的高度,字体越大,该数值应该越大
可按照css语法加入更多属性, 比如
font-weight-字体粗细,normal为正常体,粗体则为bold
font-family-字体,本站首页字体为Arial Black
和文字的对齐问题:
如果直接在文字后面跟上代码,可能看起来不对齐,用table来控制一下就对齐了:
<table cellspacing=0 cellpading=0>
<tr><td>你的文字</td><td>时间代码</td></tr></table>
如果还不对齐,调整时间代码中font-size和height的值适应你的文字大小和行高。
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
下面是javascript格式
显示日期、星期、时钟:
<script language="javascript" src="http://s.time.org.cn/js/clock.asp"></script>
显示示例: 2006年6月6日 星期二 11:06:06
javascript代码显示格式调整:在style中定义a.clock{...} |
|