Negative Border Radius in CSS?

前端 未结 3 1667

I\'m trying to do CSS to make a div that looks like this:

I\'m pretty much started with this:

.player {
    width: 480px;
    height: 80px;
    bord         


        
3条回答
  •  不思量自难忘°
    2020-12-09 13:56

    You can use the before pseudo element to provide the "cut out"

    .player {
        width: 480px;
        height: 80px;
        border-radius:0 40px 40px 0;
        background-color:#0000FF;
        position:relative;    
        color:#FFF;
    }
    
    .player:before
    {
        width: 80px;
        height: 80px;
        border-radius:0 40px 40px 0;
        background-color:#FFF;    
        display:inline-block;
        vertical-align: middle;
        margin-right: 10px;
        content: '';
    }
    Some Content

提交回复
热议问题