Html和css實現純文字和帶表徵圖的按鈕的代碼

來源:互聯網
上載者:User
這篇文章主要介紹了Html和css實現純文字和帶表徵圖按鈕的方法,按鈕有很多種外觀,本文介紹了純文字和帶表徵圖兩種按鈕,感興趣的小夥伴們可以參考一下

本文總結一下一些基礎頁面元素的實現方式,後續陸續更新。首先我們遇到最多的可能是按鈕的切圖,按鈕可能有很多種外觀,但是一般可分為純文字的和帶表徵圖的按鈕,下面就來說說這兩種按鈕的實現方法。如下:

代碼如下:

XML/HTML

</pre><pre name="code" class="html"><!DOCTYPE html><html lang="zh-CN"><head>  <title>按鈕寫法</title>  <meta charset="UTF-8">  <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">  <link rel="stylesheet" href="css/style.css"><style type="text/css">  a:hover{text-decoration: none;}       .btn{         display: inline-block;         margin-top: 10px;         padding: 10px 24px;         border-radius: 4px;         background-color: #63b7ff;         color: #fff;         cursor: pointer;       }       .btn:hover{         background-color: #99c6ff;       }       .inbtn{         border: none;       }       .bubtn{         border: none;       }       .btn{         font-style: normal;       }       .bgbtn span{         margin-left: 10px;         padding-left: 20px;         background: url(images/edit.png) left center no-repeat;       }       .bgbtn02 img{         margin-bottom: -3px;         margin-right: 10px;       }     </style></head><body><!--<a>標籤按鈕--><a href="" class="btn">a標籤按鈕</a><!--<input>標籤按鈕--><input class="inbtn btn" type="button" value="input標籤按鈕"/><!--<button>標籤按鈕--><button class="bubtn btn">button標籤按鈕</button><!--任意標籤按鈕--><i class="ibtn btn">i標籤按鈕</i><!--帶背景表徵圖按鈕--><a href="" class="bgbtn btn">  <span>帶表徵圖按鈕</span></a><a href="" class="bgbtn02 btn">  <img src="images/edit.png"/>帶表徵圖按鈕     </a></body></html>

至於各種標籤的優缺點,還是需要大家去體會啦,如果大家有什麼好玩的按鈕要寫,我們一起實現哦。

以上就是本文的全部內容,希望對大家的學習有所協助,更多相關內容請關注topic.alibabacloud.com!

相關文章

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.