css,html,js实用锦囊

 

一、好看的按钮

<!DOCTYPE html>
<html>
 <head>
  <meta charset="utf-8">
  <title>HTML CSS Exercise CSS3 button</title>
   <style type="text/css">
     button {  
        width: 200px;  
        padding:8px;  
        background-color: #428bca;  
        border-color: #357ebd;  
        color: #fff;  
        -moz-border-radius: 10px;  
        -webkit-border-radius: 10px;  
        border-radius: 10px; /* future proofing */  
        -khtml-border-radius: 10px; /* for old Konqueror browsers */  
        text-align: center;  
        vertical-align: middle;  
        border: 1px solid transparent;  
        font-weight: 900;  
        font-size:125%  
      }  
   </style>
  </head>
 <body>
  <button>
    Subscribe Now
   </button>
 </body>
</html>

二、html button按钮模拟超链接的三种方法

方法一:form表单方法

实现代码:

<form method="get" action="http://www.manongjc.com">
    <button type="submit">Continue</button>
</form>

 

方法二:window.location.href 方法

代码如下:

<button onclick="window.location.href='http://www.manongjc.com'">Continue</button>

来源:

http://www.cnblogs.com/yojiaku/p/5736447.html

http://www.manongjc.com/article/2209.html

 

 

 

 

 

 

 

 

 

 

方法三:在button之外添加超链接

<a href="http://www.manongjc.com" target="_blank">
<button>My Button</button>
</a>
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值