作者: 他在发呆 | 来源:发表于2016-12-10 15:34 被阅读0次

    用来设置锚点或超链接

    • href属性:指定链接目标
    • target :_self默认,在本窗口打开;_blank,在新窗口打开
    • title:在鼠标悬停时显示文字;
    • name : 规定名称;
    <a href="#" target="_self" title="hello"></a>
    

    a标签有四种状态:

    a:link{/*没有访问过的样式*/
          color:#f00;
    }
    a:visited{/*访问过后的样式*/
          color:cyan;
    }
    a:hover{/*鼠标滑过的样式*/
        color:#000;
    }
    a:active{/*按下时的样式*/
        color:agb(10,10,10);
    }
    
    
    a标签默认样式有下划线,通过css清除样式
    a{
        text-decoratiion:none;
    }
    
    

    跳转页面

    <a href="文件路径">跳转到指定页面</a>
    

    跳转页面的指定位置

    <a href="文件路径">跳转到指定页面#ID</a>
    

    点击跳转拨打电话

    <a href="tel:手机号" >点击拨打电话123</a>
    

    实现后退的功能

    <a href="javascript:history.go(-1)">后退</a>
    

    实现下载功能

    <a href="http://m2.music.126.net/a7-uKueLfjL2ge3rhraHRA==/7959364675015343.mp3" download="丑八怪">点击下载</a>
    

    相关文章

      网友评论

          本文标题:标签

          本文链接:https://www.haomeiwen.com/subject/tlcumttx.html