• [转载]利用CSS显示隐藏元素


    My idea was to add position:relative to the link, in order to allow the span element inside to position absolutely respect the parent link. This code has been tested in Ie5.5, Opera7.11 and Mozilla 1.4 and works fine. Solved ie bug adding some z-index, but with the modifications done this technique will be buggy in Opera7.2 .

    Now, let's have a look at the basic css code for the tooltip: 

    a.info{
        position:relative; /*this is the key*/
        z-index:24; background-color:#ccc;
        color:#000;
        text-decoration:none}

    a.info:hover{z-index:25; background-color:#ff0}

    a.info span{display: none}

    a.info:hover span{ /*the span will display just on :hover state*/
        display:block;
        position:absolute;
        top:2em; left:2em; 15em;
        border:1px solid #0cf;
        background-color:#cff; color:#000;
        text-align: center}
     
  • 相关阅读:
    树状数组&线段树
    8月7日小练
    8月6日小练
    LID&LDS 的另外一种算法
    LCS,LIS,LCIS
    8-11-Exercise
    8-10-Exercise
    线段树
    8-7-Exercise
    8-6-Exercise
  • 原文地址:https://www.cnblogs.com/romen/p/2549953.html
Copyright © 2020-2023  润新知