zoukankan      html  css  js  c++  java
  • display:block 的认识

    white-space:nowrap; + display:block  下面一种情况要注意

    <style type="text/css">
        html {
            overflow: hidden;
        }
        body {
            background: #222;
        }
        #menu {
            padding: 10px;
            background: #000;
            height: 300px;
             400px;
        }
        #menu a {
            display:block;
            text-decoration:none;
            font-family: arial, helvetica, verdana, sans-serif;
            white-space: nowrap;
        }

    </style>

    <script type="text/javascript"><!--
    var P,T;
    var over = -1;

    ///////////////
    var fontSize = 38;
    var lensFX = 1;
    var num = true;
    var color = "#FFF";
    var selected = "#F80";
    ///////////////

    function zoom(s){
        if(s!=over){
            over = s;
            for(var i=0;i<T;i++){
                P[i].style.fontSize=Math.floor(fontSize / (Math.abs(i - s) +

    lensFX) + 3)+"px";
                P[i].style.color=(i==s)?selected:color;
            }
        }
    }

    onload = function(){
        P = document.getElementById("menu").getElementsByTagName("a");
        T = P.length;
        for (var i=0;i<T;i++){
            if(num){
                x=i+".";
                if(x.length<3)x="0"+x;
                P[i].innerHTML = x+P[i].innerHTML;
            }
            P[i].style.width = "100%";
            P[i].onmouseover=new Function("zoom("+i+");");
        }
        zoom(0);
    }
    //-->
    </script>
    </head>

    <body>

        <div id="menu">
            <a href="#">scripting</a>
            <a href="#">javascript</a>
            <a href="#">web</a>
            <a href="#">dhtml</a>
            <a href="#">css</a>
            <a href="#">ajax</a>
            <a href="#">programming</a>
            <a href="#">design</a>
            <a href="#">webdesign</a>
            <a href="#">html</a>
            <a href="#">dom</a>
            <a href="#">webdev</a>
            <a href="#">reference</a>
            <a href="#">tools</a>
            <a href="#">tutorial</a>
            <a href="#">xmlhttprequest</a>
            <a href="#">menu</a>
            <a href="#">xml</a>
            <a href="#">library</a>
            <a href="#">development</a>

        </div>

    </body>

  • 相关阅读:
    Laxcus集群操作系统的分布计算模型
    LAXCUS集群操作系统能不能防止DDOS攻击
    elasticsearch安装启动过程遇到的问题
    Centos7安装snort可视化IDS平台
    网络与信息安全 -国际学术会议和期刊目录
    包的概念、导入与可见性---Go
    Encrypted Traffic Analytics 加密流量分析功能
    商务谈判技巧
    东南大学《数字图像处理》课程作业 8
    东南大学《数字图像处理》课程作业 7
  • 原文地址:https://www.cnblogs.com/luhangnote/p/2683766.html
Copyright © 2011-2022 走看看