发新话题
打印

CSS样式对齐

没听懂你说的意思,这个是我摸索你的意思改的,你看看对不?

<!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>
<script language="javascript">
function tabChange(obj,id)
{
var arrayli = obj.parentNode.getElementsByTagName("li"); //获取li数组
var arrayul = document.getElementById(id).getElementsByTagName("ul"); //获取ul数组
for(i=0;i<arrayul.length;i++)
{
  if(obj==arrayli)
  {
   arrayli.className = "cli";
   arrayul.className = "";
  }
  else
  {
   arrayli.className = "";
   arrayul.className = "hidden";
  }
}
}
</script>
<style type="text/css">
body{ height:768px; background:#2626F0;}
.tabbox{top:0px;left:0px;width:100%;height:100%;}
.tabmenu{height:80%;}
.tabmenu ul{ height:100%;}
#tabcontent ul {  margin:0;padding:5px;list-style-type: none;}
.tabmenu ul li{text-align:center; float:left;display:block;width:22%; height:90%;overflow:hidden;background:#d90202;border-left:#ccc 1px solid;border-right:#ccc 1px solid; border-bottom:#ccc 2px solid;font-size:12px;}
.tabmenu ul .cli{text-align:center;float:left;display:block;width:22%;height:90%;overflow:hidden;background:#2ad902;border: 1px solid rgb(31, 84,188);border-bottom: 2px solid rgb(31, 84, 188);display:inline;font-size:12px; /*cursor:pointer;*/}
#tabcontent .hidden{display:none;}


</style>
</head>
<body>
<div class = "tabbox">
       <div class="tabmenu">
           <ul>
                <li class="cli">1</li>
                <li>2</li>
                <li>3</li>
                <li>4</li>
           </ul>
      </div>

<div id="tabcontent">

       <ul name="tabul">
         </ul>
       <ul class="hidden">

       </ul>
       <ul class="hidden">
         </ul>

       <ul class="hidden">
          </ul>
  </div>
</div>
</body>
</html>
发新话题
最近访问的版块