zoukankan      html  css  js  c++  java
  • div border-radius画圆

    不要指定border-width属性:

    <html>
    <style type="text/css">
    div{
        border-style: solid;
        background-color: #f00;
        border-width: 50px;
        border-radius: 50px;
        width: 100px;
        height: 100px;
    }
    
    </style>
    <body>
        <div></div>
    </body>
    </html>

    效果:

    去掉border-width属性

    <html>
    <style type="text/css">
    div{
        border-style: solid;
        background-color: #f00;
        border-radius: 50px;
        width: 100px;
        height: 100px;
        background-color: #000;
        
    }
    
    </style>
    <body>
        <div></div>
    </body>
    </html>

    效果:

    怎么是106和106?

    去掉

    border-style: solid;
    <html>
    <style type="text/css">
    div{
        background-color: #f00;
        border-radius: 50px;
        width: 100px;
        height: 100px;
    }
    
    </style>
    <body>
        <div></div>
    </body>
    </html>

     所以如果你想要在:before中画一个圆,则必须让:before是一个block

    <html>
    <style type="text/css">
    div{
        margin: 400px;
    }
    div:before{
        content: "";
        display: block;
        background-color: #f00;
        border-radius: 50px;
        width: 100px;
        height: 100px;
    }
    
    </style>
    <body>
        <div></div>
    </body>
    </html>
  • 相关阅读:
    工厂模式一
    面向对象的简单理解二
    工厂模式三
    线程的简单学习
    nyoj35 表达式求值
    nyoj305 表达式求值
    poj1298 The Hardest Problem Ever
    poj1363 Rails
    hdu2036 改革春风吹满地
    nyoj467 中缀式变后缀式
  • 原文地址:https://www.cnblogs.com/ghgyj/p/4034089.html
Copyright © 2011-2022 走看看