几款好看的HTML按钮样式

来源:互联网 发布:git webhook php 编辑:程序博客网 时间:2024/05/16 01:05

给大家介绍几款好看的HTML按钮样式

按钮样式一:


[html] view plain copy
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">  
  2.   
  3. <html xmlns="http://www.w3.org/1999/xhtml">  
  4. <head runat="server">  
  5.     <title></title>  
  6.     <style>  
  7.   
  8. #login_click{ margin-top:32px; height:40px;}  
  9. #login_click a   
  10. {  
  11.       
  12.   
  13.     text-decoration:none;  
  14.     background:#2f435e;  
  15.     color:#f2f2f2;  
  16.       
  17.     padding: 10px 30px 10px 30px;  
  18.     font-size:16px;  
  19.     font-family: 微软雅黑,宋体,Arial,Helvetica,Verdana,sans-serif;  
  20.     font-weight:bold;  
  21.     border-radius:3px;  
  22.       
  23.     -webkit-transition:all linear 0.30s;  
  24.     -moz-transition:all linear 0.30s;  
  25.     transition:all linear 0.30s;  
  26.       
  27.     }  
  28.    #login_click a:hover { background:#385f9e; }  
  29.   
  30. </style>  
  31. </head>  
  32. <body>  
  33.     <form id="form1" runat="server">  
  34.     <div>  
  35.     <div style=" width:386px; height:332px; margin-left:auto; margin-right:auto">  
  36.         <div id="login_form" >  
  37.   
  38.         <div id="form_account">  
  39.         账户:<input id="txt_account" runat="server" type="text" placeholder="用户名或邮件地址" />  
  40.         </div>  
  41.         <div id="form_password" >  
  42.         密码:<input id="txt_password" runat="server" type="password" placeholder="请输入密码" />  
  43.         </div>  
  44.   
  45.         <div id="login_click">  
  46.         <a id="btlogin" href="#">登 录</a>  
  47.         </div>  
  48.       
  49.         </div>  
  50.     </div>    
  51.       
  52.     </div>  
  53.     </form>  
  54. </body>  
  55.   
  56. </html>  

按钮样式二:


[html] view plain copy
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">  
  2. <html xmlns="http://www.w3.org/1999/xhtml">  
  3. <head>  
  4. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />  
  5. <title>Image Rollover with CSS</title>  
  6. <style type="text/css" media="screen">  
  7. a.button { background:url(rss-feed-img.png) repeat 0px 0px; width: 123px; height: 44px; display: block; }  
  8. a.button span { display: none; }  
  9. a.button:hover { background: url(rss-feed-img.png) repeat 0px -44px; }  
  10. </style>  
  11. </head>  
  12. <body>  
  13. <a href="#" class="button">  
  14.  <span>RSS Feeds</span>  
  15. </a>  
  16. </body>  
  17. </html>  

按钮样式三:


[html] view plain copy
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">  
  2. <html>  
  3. <head>  
  4. <title>Untitled Document</title>  
  5. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">  
  6. <link rel="stylesheet" type="text/css" href="" />  
  7. <script type="text/javascript" src="btn.js"></script>  
  8. <style type="text/css" media="screen">  
  9. body { padding: 20px; font-size: 0.85em; font-family: georgia, serif; }  
  10. .btn { display: block; position: relative; background: #aaa; padding: 5px; float: left; color: #fff; text-decoration: none; cursor: pointer; }  
  11. .btn * { font-style: normal; background-image: url(btn2.png); background-repeat: no-repeat; display: block; position: relative; }  
  12. .btn i { background-position: top left; position: absolute; margin-bottom: -5px;  top: 0; left: 0; width: 5px; height: 5px; }  
  13. .btn span { background-position: bottom left; left: -5px; padding: 0 0 5px 10px; margin-bottom: -5px; }  
  14. .btn span i { background-position: bottom right; margin-bottom: 0; position: absolute; left: 100%; width: 10px; height: 100%; top: 0; }  
  15. .btn span span { background-position: top right; position: absolute; right: -10px; margin-left: 10px; top: -5px; height: 0; }  
  16. * html .btn span,  
  17. * html .btn i { float: left; width: auto; background-image: none; cursor: pointer; }  
  18. .btn.blue { background: #2ae; }  
  19. .btn.green { background: #9d4; }  
  20. .btn.pink { background: #e1a; }  
  21. .btn:hover { background-color: #a00; }  
  22. .btn:active { background-color: #444; }  
  23. .btn[class] {  background-image: url(shade.png); background-position: bottom; }  
  24. * html .btn { border: 3px double #aaa; }  
  25. * html .btn.blue { border-color: #2ae; }  
  26. * html .btn.green { border-color: #9d4; }  
  27. * html .btn.pink { border-color: #e1a; }  
  28. * html .btn:hover { border-color: #a00; }  
  29. p { clear: both; padding-bottom: 2em; }  
  30. form { margin-top: 2em; }  
  31. form p .btn { margin-right: 1em; }  
  32. textarea { margin: 1em 0;}  
  33.   </style>  
  34. </head>  
  35. <body>  
  36.  <p><a href="#" class="btn blue">This is a blue button</a></p>  
  37.  <p><a href="#" class="btn green">This should be a green button</a></p>  
  38.  <p><big><a href="#" class="btn blue big">Big Text</a></big></p>  
  39.  <form method="post" action="#">  
  40.  <fieldset>  
  41.  <legend>Form Example</legend>  
  42.  <div><input type="text" /></div>  
  43.  <div><textarea cols="40" rows="10"></textarea></div>  
  44.  <p><input type="Button" id="reset_btn" value="Reset" class="btn" /> <input type="Submit" id="submit_btn" value="Submit this form" class="btn pink" /></p>  
  45.  </fieldset>  
  46.  </form>  
  47. </body>  
  48. </html>  




转自:http://blog.csdn.net/u010037928/article/details/49660923

原创粉丝点击