css杂问题

IE下高度自适应border会消失的问题!
加入:
height:1%;
或者
zoom:1;

怎样可以让DIV一直定位在屏幕底部?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<style type="text/css">
<!--
body {
       margin:0px;
}
#bt{
       position:absolute;
    bottom:0px;
       left:0px;
}
-->
</style></head>

<body>

<br/>1<br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>1
<div id="bt">我一直在底部啊~~</div>
<script type="text/javascript">
<!--
       var rootel=document.documentElement; //XHTMl
       // var rootel=document.body //HTML
       var bto=document.getElementById('bt');
       function bt(){
              bto.style.top=(rootel.clientHeight-bto.offsetHeight)+rootel.scrollTop+'px';
       }
       setInterval("bt()",1);
//-->
</script>
</body>
</html>


用JS的方法搞一个隔行换色,但这就不是表格了,而是列表LI
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<style>
body{
 font-size:12px;
 line-height:21px;
 color:#3E352F;
}
ul{
 width:200px;
 list-style:none;
}
.one{
 background:#CDC194;
}
.two{
 background:#DDDABF;
}
 
</style>
<script>
function set(){
var obj=document.getElementsByTagName("li");
var num=obj.length
for(var i=0;i<num;i++){
if(i%2==0){
obj[i].className="one";
}else{
obj[i].className="two";
}
}
}
</script>
</head>
<body onload="set()">
 <ul>
  <li>1.假字以数十字为基础假字数…</li>
  <li>2.假字以数十字为基础假字数…</li>
  <li>3.假字以数十字为基础假字数…</li>
  <li>4.假字以数十字为基础假字数…</li>
  <li>5.假字以数十字为基础假字数…</li>
 </ul>

</body>
</html>

CSS图片垂直居中方法
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<style type="text/css">
<!--
body {
 margin:0;padding:0
 }
div {
 width:500px;
 height:500px;
 line-height:500px;
 border:1px solid #ccc;
 overflow:hidden;
 position:relative;
 text-align:center;
 margin:auto
 }
div p {
 position:static;
 +position:absolute;
 top:50%
 }
img {
 position:static;
 +position:relative;
 top:-50%;left:-50%;
 width:276px;
 height:110px;
 vertical-align:middle
 }
p:after {
 content:".";font-size:1px;
 visibility:hidden
 }
-->
</style>

<div><p><img src=" http://www.google.com/intl/en/images/logo.gif"/></p></div>

 LI中内容超过长度后以省略号显示的方法
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<style type="text/css">
<!--
li {
 width:200px;
 white-space:nowrap;
 text-overflow:ellipsis;
 -o-text-overflow:ellipsis;
 overflow: hidden;
 }  
/* firefox only */
  li:not(p) { /* wtf is? pls let me know*/
   clear: both;
   }
  li:not(p) a {
   max-width: 175px;
   float: left;
   }
  li:not(p):after {
   content: "...";
   float: left;
   width: 25px;
   padding-left: 5px;
   color: #df3a0e;
   }

-->
</style>
<ul>
<li><a href="#">web标准常见问题大全web标准常见问题大全</a></li>
<li><a href="#">web标准常见问题大全web标准常见问题大全</a></li>
<li><a href="#">web标准常见问题大全web标准常见问题大全</a></li>
<li><a href="#">web标准常见问题大全web标准常见问题大全</a></li>
<li><a href="#">web标准常见问题大全web标准常见问题大全</a></li>
</ul>


其他内容:
http://bbs.blueidea.com/thread-2692909-1-1.html

posted on 2007-03-16 10:15  sin  阅读(464)  评论(0编辑  收藏  举报

阳江人才网