Search code examples
cssrounded-corners

How to make rounded corner cut-out using CSS?


I'd like to make something that looks like the below image using CSS:

enter image description here I'm at a total loss on how to do that. Might someone help?


Solution

  • This can be done using two elements or one element and a pseudo-element:

    HTML:

    <div></div>
    

    CSS:

    div { position:relative; background-color:#333; padding:20px;
          margin:20px; float:left; }
    
    div:before { content:""; display:block; padding:5px; background-color:#f60;
                 border:2px solid white; position: absolute; top:-2px;
                 right:-2px;}​
    

    http://jsfiddle.net/Vv6Eb/


    Update:

    With border-top-right-radius:

    http://jsfiddle.net/Vv6Eb/1/

    Or, border-bottom-left-radius:

    http://jsfiddle.net/Vv6Eb/4/