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>
  • 相关阅读:
    14、python基础
    13、Python入门
    12、运算符、流程控制
    10、Linux(六)
    Windows 分层窗口 桌面上透明 Direct3D
    Windows 进程间通信 共享内存
    Linux 库的使用
    FFmpeg 命令行
    FFmpeg 摄像头采集
    FFmpeg input与output 函数流程
  • 原文地址:https://www.cnblogs.com/ghgyj/p/4034089.html
Copyright © 2011-2022 走看看