zoukankan      html  css  js  c++  java
  • 选项卡效果

    选项卡效果

    <!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=utf-8" />
    <title>无标题文档</title>
    <style>
    *{ margin:0px auto;
       padding:0px;}
    #menu{ 240px;
           height:30px;}
    .list{ 60px;
           height:30px;
           float:left;
           text-align:center;
           line-height:30px;
           vertical-align:middle;}          
    .list:hover{ cursor:pointer;}
    .nr{ 240px;
         height:200px;
         text-align:center;
         vertical-align:middle;
         line-height:200px;
        }
    </style>
    </head>

    <body>
    <div style="700px; height:500px; margin-top:30px;">
        <div id="menu">
             <div class="list" style="娱乐</div>
             <div class="list" style="社会</div>
             <div class="list" style="体育</div>
             <div class="list" style="军事</div>
        </div>
        <div id="d1" class="nr" style="娱乐内容</div>
        <div id="d2" class="nr" style="display:none">社会内容</div>
        <div id="d3" class="nr" style="display:none">体育内容</div>
        <div id="d4" class="nr" style="display:none">军事内容</div>
    </div>
    </body>
    </html>
    <script type="text/javascript">
    function Show(id)
    { var attr=    document.getElementsByClassName("nr");
     for(var i=0; i<attr.length;i++)
        {
         attr[i].style.display="none";
        } document.getElementById(id).style.display="block";
    }
    </script>

  • 相关阅读:
    chapter16 计算机体系结构基础
    ASP.NET 2.0加密Web.config 配置文件
    用IIS6.0的Kernel Caching 压缩技术提高应用程序性能
    .net中怎样执行一个字符串
    ASP.NET 页面生存周期中的关键事件
    ASP.NET获取客户端IP及MAC地址
    DOS命令关闭计算机
    1个式子检测密码强度
    徐州话六级考试
    .net2.0中新增的Substitution控件
  • 原文地址:https://www.cnblogs.com/zhaohui123/p/6672578.html
Copyright © 2011-2022 走看看