Transparent half circle cut out of a div

前端 未结 8 2440
一生所求
一生所求 2020-11-22 05:34

I would like to make a transparent cut out half circle shape using only CSS3. The only requirement is that all the elements that form the shape must

8条回答
  •  無奈伤痛
    2020-11-22 06:02

    Try this.

    body{
      
      background-color:#333;
      passing:0px;
      height:0px;
      
    }
    #app{
      background:#333 url('https://source.unsplash.com/random') no-repeat;
      background-size:cover;
      width:360px;
      height:560px;
      position:relative;
      overflow:hidden;
    }
    .app-bar{
      width:100%;
      height:50px;
      position:absolute;
      bottom:0px;
      left:0;
      
      
        
    }
    
    .app-bar .bar{
      line-height:50px;
      
      position:relative;
      width:100%;
      height:50px;
      background-image: radial-gradient(circle 35px at 315px 0, transparent 700px, #f44336 50px);
        
    }
    
    
    .app-bar .bar i{
      color:#FFF;
      display:block;
      line-height:50px;
      float:left;
      width:50px;
      text-align:center;
      cursor:pointer;
      margin-top:0px;
    }
    .app-bar .bar i:hover{
      background-color:rgba(0,0,0,.1);
    }
    .app-bar .bar button{
      padding:0px;
      box-sizing:border;
      text-align:center;
      margin:0px;
      bordeR:0px;
      outline:0px;
      width:60px;
      height:60px;
      line-height:60px;
      cursor:pointer;
      color:#FFFFFF;
      display:block;
      border-radius:50%;
      position:absolute;
      top:-30px;
      left:100%;
      margin-left:-75px;
      background-color:#f44336;
      transition: all .2s ease;
      
    }
    .app-bar .bar button span{
      line-height:60px;
      font-size:30px;
      
    }
    .app-bar .bar button:hover{
      transform:rotate(45deg);
      transition: all .2s ease;
    }
    menu search

提交回复
热议问题