css如何设置圆角边框

css如何设置圆角边框,第1张

css如何设置圆角边框

css设置圆角边框的方法是使用圆角边框【border-radius】实现,如果这四个弧度的圆角相同,可以写成【border-radius:30px;】。

本教程 *** 作环境:windows7系统、css3版,DELL G3电脑。

css设置圆角边框的方法:

圆角边框(border-radius)的基本用法:

圆角边框的最基本用法就是设置四个相同弧度的圆角

boder-top-left-radius:30px;      //左上角
boder-top-right-radius:30px;   //右上角
boder-bottom-left-radius:30px;  //右下角
boder-bottom-right-radius:30px; //左下角

如果这四个弧度的圆角相同,可以写成:

border-radius:30px;

css设置圆角边框:

css部分:

.div1{
            margin:0 auto;
            background: darkcyan;
            width:200px;
            height:200px;
            border:2px solid darkslategray;
            border-radius:30px;
            text-align: center;
            line-height: 200px;
        }

html部分:

 <div class="div1">圆角边框</div>

效果如图:

相关教程推荐:CSS视频教程

以上就是css如何设置圆角边框的详细内容,

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/web/693749.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-04-22
下一篇 2022-04-22

发表评论

登录后才能评论

评论列表(0条)

保存