美文网首页
2019-04-21

2019-04-21

作者: 蓝子_23d0 | 来源:发表于2019-04-21 00:30 被阅读0次

    按钮水平居中放在容器中

    代码如下:

    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta http-equiv="X-UA-Compatible" content="ie=edge">
        <title>demo</title>
        <style>
            #content {
                background:#ccc;
                padding:40px 0;
                text-align:center;
            }
            .bstyle {
               
                display: inline-block;
                background-color:red;
                color:#fff;
                border-radius:4px;
                text-decoration: none;
                padding:5px 5px;
                border: none;
    
            }
        
        </style>
    </head>
    <body>
        <div id = "content">
            <button class = "bstyle">按钮1</button>
            <button class = "bstyle">按钮2</button>
            <button class = "bstyle">按钮3</button>
    
        </div>
        
    </body>
    </html>
    

    预览链接

    相关文章

      网友评论

          本文标题:2019-04-21

          本文链接:https://www.haomeiwen.com/subject/zyorgqtx.html