• 技术文章 >web前端 >前端问答

    css border-radius属性怎么用

    藏色散人藏色散人2019-05-29 13:24:03原创1405
    css border-radius属性是一个简写属性,用于设置四个 border-*-radius 属性,其语法是语法border-radius: 1-4 length|% / 1-4 length|%。

    css border-radius属性怎么用?

    作用:简写属性,用于设置四个 border-*-radius 属性。

    语法:

    border-radius: 1-4 length|% / 1-4 length|%;

    说明:

    length 定义圆角的形状。

    % 以百分比定义圆角的形状。

    注释:

    按此顺序设置每个 radii 的四个值。如果省略 bottom-left,则与 top-right 相同。如果省略 bottom-right,则与 top-left 相同。如果省略 top-right,则与 top-left 相同。

    css border-radius属性使用示例

    <!DOCTYPE html>
    <html>
    <head>
    <style> 
    div
    {
    text-align:center;
    border:2px solid #a1a1a1;
    padding:10px 40px; 
    background:#dddddd;
    width:350px;
    border-radius:25px;
    -moz-border-radius:25px; /* 老的 Firefox */
    }
    </style>
    </head>
    <body>
    <div>border-radius 属性允许您向元素添加圆角。</div>
    </body>
    </html>

    效果输出:

    db4eea238199fb19296fe9575702484.png

    以上就是css border-radius属性怎么用的详细内容,更多请关注php中文网其它相关文章!

    声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn核实处理。
    专题推荐:css border-radius
    上一篇:css outline-offset属性怎么用 下一篇:css border-right属性怎么用
    VIP课程(WEB全栈开发)

    相关文章推荐

    • 【腾讯云】年中优惠,「专享618元」优惠券!• css margin-left属性怎么用• css @media属性怎么用• css margin-top属性怎么用• css outline-offset属性怎么用
    1/1

    PHP中文网