css怎麼設定超連結?css超連結樣式的設定方法

來源:互聯網
上載者:User

本篇文章給大家帶來的內容是關於css超連結如何設定?css超連結樣式的設定方法,有一定的參考價值,有需要的朋友可以參考一下,希望對你有所協助。

1、簡單超連結
box.html

<!doctype html><html><head>    <mate charset="utf-8">    <title>超連結</title>    <link href="link.css" type="text/css" rel="stylesheet"></head><body>    <p>        <a href="#" class="link">首頁</a>    </p></body></html>

link.css

a.link{    text-decoration:none;        font-size:23px;        display:black;    }

2、偽類:某一個屬性的某一個狀態;
超連結的4種狀態:
link(未被訪問時的狀態);
visited(使用者已訪問的狀態);
hover(滑鼠經過時的狀態);
active(滑鼠點擊時狀態);

link.css

a:link{    font-size:41px;        color:black;        text-decoration: none;    }a:visited{    font-size:23px;        color:pink;        background-color: pink;    }a:hover{     font-size: 34px;         color:green;         background-color: #123456;     }a:active{    color:blue;        font-size: 60px;        background-color: #498544;    }
相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.