用CSS實現連結的虛線底線效果_CSS/HTML

來源:互聯網
上載者:User
修改您的樣式表,找下邊這段(一般都在開頭)
a {
color:#3399FF;
font-weight:Normal; /*字型效果 普通 可以改成bold粗體*/
text-decoration:none; /*底線效果:無底線*/
}

a:hover {
color:#4499EE;
text-decoration:none; /*底線效果:無底線*/
border-bottom: 1px #0099CC dotted /*加一個只有下邊的框 邊框為虛線*/
}

   a{}控制串連的效果 a:hover{}控制滑鼠移上去的效果。
一些CSS定義虛線執行個體代碼
<style> table{width:200px;height:100px;} .table1{border:1px solid #6E6B85} .table2{border:1px solid #000 dotted} .table3{border-top:1px solid #f00 dotted;border-left:1px solid #f00 dotted;} .table3 td{border-right:1px solid #f00 dotted;border-bottom:1px solid #f00 dotted;} .table4 td{border:1px solid #f00 dotted;} </style> <table class="table1"> <tr align="center"> <td>TD一</td><td>TD二</td> </tr> </table> <table class="table2"> <tr align="center"> <td>TD一</td><td>TD二</td> </tr> </table> <table class="table3"> <tr align="center"> <td>TD一</td><td>TD二</td> </tr> </table> <table class="table4"> <tr align="center"> <td>TD一</td><td>TD二</td> </tr> </table>
[Ctrl+A 全選 注:如需引入外部Js需重新整理才能執行]
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <title>建立網頁 2</title> </head> <body> <table width=150px height=150px> <tr > <td style="border-top:1px dotted buttonface"> haha</td> <td style="border-top:1px dotted buttonface;border-left:1px dotted buttonface">haha</td> </tr> <tr> <td style="border-top:1px dotted buttonface;border-bottom:1px dotted buttonface">haha</td> <td style="border-top:1px dotted buttonface;border-left:1px dotted buttonface;border-bottom:1px dotted buttonface">haha</td> </tr> </table> </body> </html>
[Ctrl+A 全選 注:如需引入外部Js需重新整理才能執行]
<table width="100" height="100" border="0" cellpadding="0" cellspacing="0" style="border: 1px dashed #000000;"> <tr> <td> </td> </tr> </table>
[Ctrl+A 全選 注:如需引入外部Js需重新整理才能執行]
<table> <tr align="center"> <td style="width:100px;height:100px;border-right:1px solid #f00 dotted;border-left:1px solid #f00 dotted">TD</td> </tr> </table>
[Ctrl+A 全選 注:如需引入外部Js需重新整理才能執行]
<table> <tr align="center"> <td style="width:100px;height:100px;border:dotted 1px black; border-width:0 1px;">TD</td> </tr> </table>
[Ctrl+A 全選 注:如需引入外部Js需重新整理才能執行]
  • 相關文章

    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.