一些简易的代码,可以美化你的博客(2)

修改网页的默认鼠标指针样式:
<style type="text/css">
BODY{CURSOR: url(hy.ani);
</style>

BLOG里增加水滴效果:
<CENTER><EMBED style="LEFT: 10px; POSITION: absolute; TOP: -70px" align=right src=http://www.mydeskcity.com/Images/drip.swf width=700 height=400 type=application/x-shockwave-flash wmode="transparent" quality="high" ;></CENTER>

BLOG上走動的文字:
基本语法:
<marquee> ... </marquee>
<marquee>啦啦啦,我会移动耶!</marquee>

文字移动属性的设置:
方向 <direction=#> #=left, right, up, down
<marquee direction=left>啦啦啦,我从右向左移!</marquee>
<marquee direction=right>啦啦啦,我从左向右移!</marquee>
<marquee direction=up>啦啦啦,我从下向上移!</marquee>
<marquee direction=down>啦啦啦,我从上向下移!</marquee>

方式 <bihavior=#> #=scroll, slide, alternate
<marquee behavior=scroll>啦啦啦,我一圈一圈绕着走!</marquee>
<marquee behavior=slide>啦啦啦,我只走一次就歇了!</marquee>
<marquee behavior=alternate>啦啦啦,我来回走耶!</marquee>

循环 <loop=#> #=次数;若未指定则循环不止(infinite)
<marquee loop=3 width=50% behavior=scroll>啦啦啦,我只走 3 趟哟!</marquee>
<marquee loop=3 width=50% behavior=slide>啦啦啦,我只走 3 趟哟!</marquee>
<marquee loop=3 width=50% behavior=alternate>啦啦啦,我只走 3 趟哟!</marquee>

速度 <scrollamount=#>
<marquee scrollamount=20>啦啦啦,我走得好快哟!</marquee>
延时 <scrolldelay=#>
<marquee scrolldelay=500 scrollamount=100>啦啦啦,我走一步,停一停!</marquee>
外观(Layout)设置:
对齐方式(Align) <align=#>  #=top, middle, bottom
<font size=6>
<marquee align=# width=400>啦啦啦,我会移动耶!</marquee>
</font>
对齐上沿、中间、下沿。
底色 <bgcolor=#>
#=rrggbb 16 进制数码,或者是下列预定义色彩:
Black, Olive, Teal, Red, Blue, Maroon, Navy, Gray, Lime,
Fuchsia, White, Green, Purple, Silver, Yellow, Aqua
<marquee bgcolor=aaaaee>啦啦啦,我会移动耶!</marquee>
面积 <height=# width=#>
<marquee height=40 width=50% bgcolor=aaeeaa>
啦啦啦,我会移动耶!
</marquee>
空白(Margins)<hspace=# vspace=#>
********************************************<br>
嗨,
<marquee hspace=20 vspace=20 width=150 bgcolor=ffaaaa align=middle>啦啦啦,我会移动耶!</marquee>
大家好!<br>
********************************************

设置BLOG背景:
进入BLOG用户后台管理-模板设置-修改主模板-源码,将以下代码复制并插入所有代码的最上方,就可以了:
<style type=text/css>
<!--
body{
    background:url(这里填写背景图片地址) #ffffff repeat scroll!important;
}
-->
</style>

相关解释:
1。将括号里面的“这里填写背景图片地址”替换为你所要显示的背景图片的url地址。
2。#ffffff表示背景颜色为#ffffff(白色)修改为你想要的背景颜色代码。
3。repeat表示图片平铺,不平铺改为no-repeat。
4。scroll表示图片随对象滚动,图片固定不滚动改为fixed。
5。!important表示这里的设置优先,不要将它去掉,否则有可能会引起冲突,造成显示不正常!

使状态区出现文字:
(一)文字来回出现:
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
var Message='文字';
var place=1;
function scrollIn() {
window.status=Message.substring(0, place);
if (place >= Message.length) {
place=1;
window.setTimeout("scrollOut()",300);
} else {
place++;
window.setTimeout("scrollIn()",50);
   }
}
function scrollOut() {
window.status=Message.substring(place, Message.length);
if (place >= Message.length) {
place=1;
window.setTimeout("scrollIn()", 100);
} else {
place++;
window.setTimeout("scrollOut()", 50);
   }
}
window.onload=scrollIn;
// End -->
</SCRIPT>

(二)逐个显示文字:
<script language="Javascript">
<!--
myMsg = "文字"
i=0
function scrollMsg() {
frontPart = myMsg.substring(i,myMsg.length)
backPart = myMsg.substring(0,i)
//window.status = frontPart + backPart
window.status = backPart
if (i < myMsg.length) {
i++
}
else {
i = 0
}
setTimeout("scrollMsg()",200)
}
window.onload=scrollMsg
//-->
</script>

小窗口代码:
<SCRIPT>
var oPopup = window.createPopup();
var popTop=50;
function popmsg(msgstr){
var winstr="<table style=\"border: 1 solid  #eeeeee\"  width=\"241\" height=\"172\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"  bgcolor=\"#000000\">";
winstr+="<tr><td height=\"5\"> </td></tr><tr><td align=\"center\"><table width=\"90%\" height=\"110\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">";
winstr+="<tr><td valign=\"top\" style=\"font-size:12px; color: #eeeeee; face: Comic Sans Ms\">"+msgstr+"</td></tr></table></td></tr></table>";
oPopup.document.body.innerHTML = winstr;
popshow();
}
function popshow(){
window.status=popTop;
if(popTop>1720){
clearTimeout(mytime);
oPopup.hide();
return;
}else if(popTop>1520&&popTop<1720){
oPopup.show(screen.width-250,screen.height,241,1720-popTop);
}else if(popTop>1500&&popTop<1520){
oPopup.show(screen.width-250,screen.height+(popTop-1720),241,172);
}else if(popTop<180){
oPopup.show(screen.width-250,screen.height,241,popTop);
}else if(popTop<220){
oPopup.show(screen.width-250,screen.height-popTop,241,172);
}
popTop+=10;
var mytime=setTimeout("popshow();",50);
}

<SCRIPT language=javascript>
function click() {
if (event.button==2) {
alert('文字文字')
}
}
document.onmousedown=click
</SCRIPT>

关于文字排版:
可以在word中进行排版,然后再复制到blog中,会基本保持word中的字体设置和版面。

posted on 2006-03-30 23:07  lubosun  阅读(343)  评论(0编辑  收藏  举报

导航