网站建设资讯

NEWS

网站建设资讯

使用border-radius属性怎么给元素添加圆角边框

本篇文章为大家展示了使用border-radius属性怎么给元素添加圆角边框,内容简明扼要并且容易理解,绝对能使你眼前一亮,通过这篇文章的详细介绍希望你能有所收获。

为弓长岭等地区用户提供了全套网页设计制作服务,及弓长岭网站建设行业解决方案。主营业务为成都做网站、成都网站建设、弓长岭网站设计,以传统方式定制建设网站,并提供域名空间备案等一条龙服务,秉承以专业、用心的态度为用户提供真诚的服务。我们深信只要达到每一位用户的要求,就会得到认可,从而选择与我们长期合作。这样,我们也可以走得更远!

border-radius:10px; /* 所有角都使用半径为10px的圆角 */

使用border-radius属性怎么给元素添加圆角边框

border-radius: 5px 4px 3px 2px; /* 四个半径值分别是左上角、右上角、右下角和左下角,顺时针 */

使用border-radius属性怎么给元素添加圆角边框

不要以为border-radius的值只能用px单位,你还可以用百分比或者em,但兼容性目前还不太好。

实心上半圆:

方法:把高度(height)设为宽度(width)的一半,并且只设置左上角和右上角的半径与元素的高度一致(大于也是可以的)。

div{   
  
  height:50px;/*是width的一半*/     
  width:100px;   
  background:#9da;     
  border-radius:50px 50px 0 0;/*半径至少设置为height的值*/     
  }

实心圆:

方法:把宽度(width)与高度(height)值设置为一致(也就是正方形),并且四个圆角值都设置为它们值的一半。

如下代码:

div{   
  height:100px;/*与width设置一致*/    
  width:100px;   
   background:#9da;   
   border-radius:50px;/*四个圆角值都设置为宽度或高度值的一半*/    
  }

完整代码

  
  
  
  
border-radius</www.dztcsd.com/title>  
<style type="text/css">  
div.circle{   
    height:100px;/*与width设置一致*/   
    width:100px;   
    background:#9da;   
    border-radius:50px;/*四个圆角值都设置为宽度或高度值的一半*/   
    }   
/*任务部分*/      
div.semi-circle{    
    height:100px;   
    width:50px;   
    background:#9da;   
    border-radius:?;   
    }   
      
</style>  
</head>  
<body>  
<div class="circle">  
</div>  
<br/>  
<!--任务部分-->  
<div class="semi-circle">  
</div>  
  
</body>  
</html></pre><p>上述内容就是使用border-radius属性怎么给元素添加圆角边框,你们学到知识或技能了吗?如果还想学到更多技能或者丰富自己的知识储备,欢迎关注创新互联行业资讯频道。</p>            
            
                        <br>
            本文标题:使用border-radius属性怎么给元素添加圆角边框            <br>
            文章位置:<a href="https://xinyudec.cn/article/gjesgo.html">https://xinyudec.cn/article/gjesgo.html</a>
        </div>
    </div>
    <div class="other">
        <h3>其他资讯</h3>
        <ul>
            <li>
                    <a href="/article/ehogo.html">香港服务器与高防服务器是怎么样快速赚钱-创新互联</a>
                </li><li>
                    <a href="/article/iegojd.html">thinkphp怎么引用PHPExcel类库</a>
                </li><li>
                    <a href="/article/jdheij.html">怎么用CSS实现DIV层叠</a>
                </li><li>
                    <a href="/article/dossice.html">go语言权限设计 go语言设计者</a>
                </li><li>
                    <a href="/article/ddcijjo.html">本地wordpress搭建 wordpress本地安装详细教程</a>
                </li><li>
                    <a href="/article/dsjgjeg.html">搭建腾讯云服务器python 腾讯云部署python</a>
                </li><li>
                    <a href="/article/dijicph.html">怎么到mysql的命令 mysql命令导入sql</a>
                </li><li>
                    <a href="/article/dghpdej.html">如何判断网站建设价格是不是合理</a>
                </li><li>
                    <a href="/article/djgdohe.html">租用海外服务器部署邮箱网站的好处有哪些</a>
                </li><li>
                    <a href="/article/cdodghd.html">VideoCMS存在SQL注入漏洞使用此CMS的公司请做防范</a>
                </li>        </ul>
    </div>
</div>
</div>
<footer>
    <div class="footop">
        <div class="wrap">
            <div class="bottomrpw">
                <div class="erp arp">
                    <dl>
                        <dt>ADDRESS</dt>
                        <dd class="address"> <i class="icon"></i> <span class="word">成都市青羊区锦天国际1号楼1002室</span> </dd>
                    </dl>
                </div>
                <div class="erp arp">
                    <dl>
                        <dt>TEL</dt>
                        <dd class="phonum"> <i class="icon"></i> <span class="word en"> <a href="tel:18980820575">18980820575</a> </span> </dd>
                    </dl>
                </div>
                <div class="erp crp">
                    <dl>
                        <dt>OTHER</dt>
                        <dd> <a class="word get-quote" href="http://www.cdkjz.cn/fangan/">获得报价与方案</a> </dd>
                        <dd> <a href="https://www.cdxwcx.com/pay/" target="_blank" class="word" title="付款方式">付款方式</a> </dd>
                    </dl>
                </div>
                <div class="erp code-rp">
                    <dl>
                        <dt>Wechat</dt>
                        <dd class="code-wrap"> <span class="code"> <img src="/Public/Home/images/qr-code.jpg" alt="新宇德琛微信公众号" /> </span> </dd>
                    </dl>
                </div>
            </div>
        </div>
    </div>
    <div class="footerbot">
        <div class="friendlinks">
            <div class="wrap">
                <ul class="rpl">
                    <li><a href="https://www.cdcxhl.cn/jigui.html" title="成都机房机柜租用" target="_blank">成都机房机柜租用</a></li><li><a href="http://www.kmjierui.cn/" title="柔性防护网" target="_blank">柔性防护网</a></li><li><a href="http://www.cdhangkongwuliu.com/" title="成都航空物流" target="_blank">成都航空物流</a></li><li><a href="http://www.cxhlcq.com/" title="重庆网站建设" target="_blank">重庆网站建设</a></li><li><a href="http://www.cqaru.com/" title="不锈钢雕塑" target="_blank">不锈钢雕塑</a></li><li><a href="http://www.tyjike.cn/" title="图文广告设计" target="_blank">图文广告设计</a></li><li><a href="http://www.dmvi.cn/ser/huace/" title="成都画册设计公司" target="_blank">成都画册设计公司</a></li><li><a href="http://www.ghfdjzy.com/" title="贝锐智能" target="_blank">贝锐智能</a></li><li><a href="http://www.fqtzla.com/" title="成都网站建设" target="_blank">成都网站建设</a></li><li><a href="http://www.nbuln.com/" title="成都发电机维修" target="_blank">成都发电机维修</a></li>                </ul>
            </div>
        </div>
        <div class="wrap">
            <div class="copyright"> <span class="en">©2007-2026</span> 成都新宇德琛机电有限公司 <span class="en">ALL RIGHTS
                        RESERVED.</span> <a rel="nofollow" href="https://beian.miit.gov.cn/" target="_blank">蜀ICP备2025128472号</a> </div>
        </div>
    </div>
</footer>
<div class="fcwrap">
    <ul class="rpl clearfix">
        <li class="phone"> <a rel="nofollow" target="_blank" href="tel:18980820575"> <i class="icon"></i>
            <strong>18980820575</strong> </a> </li>
        <li class="qq"> <a rel="nofollow" target="_blank"
                           href="https://wpa.qq.com/msgrd?v=1&uin=244261566&site=qq&menu=yes"> <i class="icon"></i>
            <strong>244261566</strong> </a> </li>
        <li class="back-top"> <a href="javascript:void(0)" rel="nofollow" class="back-to-top"> <i class="icon"></i>
            <strong>回到顶部</strong> </a> </li>
    </ul>
</div>
<!--nav-->
<div class="n-Wrap">
    <div class="navBar visble show">
        <div class="barlogo">
            <a href="/" rel="nofollow">
                <img src="/Public/Home/images/logo1.png" alt="成都做网站" />
                <img src="/Public/Home/images/logo2.png" alt="成都网站设计" />
            </a>
        </div>
        <div class="bmenu">
            <i class="bar-top"><span></span></i>
            <i class="bar-cen"><span></span></i>
            <i class="bar-bom"><span></span></i>
            <i class="bar-left"><span></span></i>
            <i class="bar-right"><span></span></i>
        </div>
    </div>
    <section class="fixmenu">
        <div class="close-bar">
            <i class="bar-left"><span></span></i>
            <i class="bar-right"><span></span></i>
        </div>
        <nav class="smph">
            <ul>
                <li class="index-hrefs on"><a href="http://www.xinyudec.cn/" title="网站首页"><font>首页</font></a></li>
                <li><a href="/about/" rel="nofollow"><font>关于我们</font></a></li>
                <li><a href="/service/" rel="nofollow"><font>网站建设</font></a></li>
                <li><a href="/case/" rel="nofollow"><font>网站案例</font></a></li>
                <li><a href="/solve/" rel="nofollow"><font>网站方案</font></a></li>
                <li><a href="/news/" rel="nofollow"><font>建站知识</font></a></li>
                <li><a href="/contact/" rel="nofollow"><font>联系新宇德琛</font></a></li>
            </ul>
            <div class="pwrap">
                <span class="label">建站热线</span>
                <strong class="phone"><a href="tel:18980820575">18980820575</a></strong>
            </div>
        </nav>
    </section>
</div>
<!--end nav-->
<script src="/Public/Home/js/hotcss.js"></script>
<script type="text/javascript" src="/Public/Home/js/su_new.js"></script>
</body>
</html>
<script>
    $(".con img").each(function(){
        var src = $(this).attr("src");    //获取图片地址
        var str=new RegExp("http");
        var result=str.test(src);
        if(result==false){
            var url = "https://www.cdcxhl.com"+src;    //绝对路径
            $(this).attr("src",url);
        }
    });
    window.onload=function(){
        document.oncontextmenu=function(){
            return false;
        }
    }
</script>