当前位置:Gxlcms > JavaScript > cssborder-radius属性怎么用

cssborder-radius属性怎么用

时间:2021-07-01 10:21:17 帮助过:65人阅读

css border-radius属性是一个简写属性,用于设置四个 border-*-radius 属性,其语法是语法border-radius: 1-4 length|% / 1-4 length|%。

css border-radius属性怎么用?

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

语法:

  1. 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属性使用示例

  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <style>
  5. div
  6. {
  7. text-align:center;
  8. border:2px solid #a1a1a1;
  9. padding:10px 40px;
  10. background:#dddddd;
  11. width:350px;
  12. border-radius:25px;
  13. -moz-border-radius:25px; /* 老的 Firefox */
  14. }
  15. </style>
  16. </head>
  17. <body>
  18. <div>border-radius 属性允许您向元素添加圆角。</div>
  19. </body>
  20. </html>

效果输出:

db4eea238199fb19296fe9575702484.png

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

人气教程排行