按钮实现

带圆角按钮的实现

  • 实现按钮的方式

    • button: 行内块级元素

      • <input type="button">: 表单组件
      • <button>: 按钮
    • a: 链接,在鼠标悬停的时候可以提供不同的样式

    • div

  • 实现主要看自己选择什么,主要是css样式
    在这里插入图片描述

  • button

    html

    <input type="button" value="点击">
    <br>
    <br>
    <button value="点击">点击</button>
    

    css

           input{
                border: 1px  solid rgba(120,188,133,0.5);
                width: 126px;
                height: 46px;
                border-radius: 23px;
                background-color: transparent;
                font-size: 14px;
                font-weight: 200;
                color: #00CD00;
            }
    
            button{
                border: 1px  solid rgba(120,188,133,0.5);
                width: 126px;
                height: 46px;
                border-radius: 23px;
                background-color: transparent;
                font-size: 14px;
                font-weight: 200;
                color: #00CD00;
            }
    		input:hover,button:hover{
                background-color: #00CD0020;
            }
    
  • a标签

    html

    <a href="#">点击</a>
    

    css

           a{
                display: inline-block;
                text-decoration: none;
                width: 126px;
                height: 46px;
                border: 1px  solid rgba(120,188,133,0.5);
                background-color: transparent;
                font-size: 14px;
                font-weight: 200;
                border-radius: 23px;
                color: #00CD00;
                text-align: center;
                line-height: 46px;
            }
    		a:hover{
                background-color: #00CD0020;
            }
    
  • div一个圆的按钮

    在这里插入图片描述
    在这里插入图片描述

    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>02</title>
        <style type="text/css">
            .box_1{
                display: inline-block;
                width: 38px;
                height: 38px;
                border: 1px  solid rgba(120,188,133,0.5);
                border-radius: 22px;
                padding: 3px;
            }
    
            .box_2{
                width: 38px;
                height: 38px;
                border-radius: 19px;
                background-color: #00CD0030;
    
                background-image:url("imgs/edit-icon.png");
                background-size: 19px 20px;
                background-repeat: no-repeat;
                background-position: center;
            }
    
        </style>
    </head>
    <body>
        <div class="box_1">
            <div class="box_2">
    
            </div>
        </div>
    </body>
    </html>
    
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值