+ -
当前位置:首页 → 问答吧 → W3C UL 展开LI无法占位

W3C UL 展开LI无法占位

时间:2011-04-26

来源:互联网

HTML code

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <title> New Document </title>
  <meta name="Generator" content="EditPlus">
  <meta name="Author" content="">
  <meta name="Keywords" content="">
  <meta name="Description" content="">
 </head>
<style>
li {display:none;;height:20px;background-color:green;}
ul {margin:0px;height:20px;background-color:#ccc;border:1 solid #ffc;  list-style: none;}
</style>
<script>
   function show()
   {
       var o = event.srcElement;
       var childs = o.children
       for(var i in childs)
           if(childs[i].tagName=="LI")
               childs[i].style.display = "block"
    }
</script>
 <body>
  <ul onclick="show()">
    <li>1</li>
        <li>1</li>
            <li>1</li>
                <li>1</li>
                </ul>

<ul onclick="show()">
    <li>A</li>
        <li>A</li>
            <li>A</li>
                <li>A</li>
</ul>
 </body>
</html>



作者: coley   发布时间: 2011-04-26

这个展开UL,下面的LI是无法撑开下面的UL的.取消W3C是可以的,,请问在w3c下面如何操作呢

作者: coley   发布时间: 2011-04-26

热门下载

更多