CSS 圆角

作者: roy_pub | 来源:发表于2018-12-08 13:31 被阅读8次

    border-radius

    <!DOCTYPE html>
    <html lang="en">
    <head>
        <style type="text/css">
            .border_one {
                width: 100px;
                height: 100px;
                background-color: orange;
                border-radius: 20px;
                display: inline-block;
                border: 2px solid red;
            }
    
            .border_two {
                width: 100px;
                height: 100px;
                background-color: pink;
                border-radius: 50%;
                display: inline-block;
                border: 2px solid red;
            }
    
            .border_thr {
                width: 100px;
                height: 100px;
                background-color: green;
                border-radius: 50% 0 50% 0;
                display: inline-block;
                border: 2px solid red;
            }
    
            .border_fou {
                width: 100px;
                height: 100px;
                background-color: greenyellow;
                border-radius: 20px 0 0 20px;
                display: inline-block;
                border: 2px solid red;
            }
    
        </style>
    </head>
    <body>
        <div class="border_one"></div>
        <div class="border_two"></div>
        <div class="border_thr"></div>
        <div class="border_fou"></div>
    </body>
    </html>
    
    <!DOCTYPE html>
    <html lang="en">
    <head>
        <style type="text/css">
            div {
                background-color: rgba(0,0,0,0.5);
                height: 200px;
            }
    
            a {
                display: inline-block;
                width: 100px;
                height: 100px;
                background-color: white;
                text-align: center;
                line-height: 100px;
                text-decoration: none;
                margin: 50px;
                border-radius: 50%;
                color: pink;
    
            }
    
            a:hover {
                color: white;
                background-color: pink;
            }
    
        </style>
    </head>
    <body>
        <div>
            <a href="#">One</a>
            <a href="#">Two</a>
            <a href="#">Three</a>
            <a href="#">Four</a>
        </div>
    </body>
    </html>
    

    相关文章

      网友评论

        本文标题:CSS 圆角

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