css常用技巧

来源:互联网 发布:数据挖掘常用软件 编辑:程序博客网 时间:2024/06/05 09:54

一、让浏览器显示word格式文本

 <meta  http-equiv="content-type"   content="application/msword" />

二、设置浮动背景

<style>

 body{ background-attachment:fixed;background-image:url(image/1.gjf);}

</style> 

三、正确对齐文本

<style>

.dq{margin-left:68px;margin-right:70px;margin-top:69px;margin-bottom:71px;}

</style>

四、解决list-style-image无法正确定位的问题

<style>

li{ list-style:url ("http://gluu5.163.com//E/11/ 6.gif");}

li a{position:relative;top:-5px;font:12px/25px  宋体;}

</style>

五、使一个层垂直居中于浏览器

<style>

div{

  position:absolute;

  top:70%;

  left:50%;

  margin:-150px 0 0 -150px;

  width:200px;

  height:200px;

  border:1px solid #0066ff;

}

</style>

六、巧妙设置滚动条颜色

<style>

html{

  scrollbar-face-color:#f6f6f6;

  scrollbar-highlight-color:#fff000;

  scrollbar-shadow-color:#ee00ee;

  scrollbar-3dlight-color:#ee222e;

  scrollbar-arrow-color:#ccc000;;

  scrollbar-track-color:#ddeecc;

  scrollbar-darkshadow-color:#fffddd;

}

</style>

七、实现图片循环隐现的效果

<script>

var b=1;

var c=true;

function fade( ){

  if( document.all );

  if( c==true ){

  b++;

}

if ( b==100 ){

 b--;

 c=false;

}

if ( b==10){

 b++;

 c=true;

}

if( c==false ){

 b--;

}

u.filters.alpha.opacity= 0 +b;

setTimeout(" fade( ) " ,50 );

}

</script>

<body onLoad="fade( )"><img align="middle"    name="n"   style="filter:alpha(opacity=0) /></body>

八、禁止保存页面

<noscript><iframe  src="*.htm"></iframe></noscript>

九、禁止页面最小化

<body onblur='self.focus( );'

0 0
原创粉丝点击