css border radius rectangle code example

Example 1: css rounded corners

/* Set rounded corners with border-radius property */

.class {
  border-radius: 4px;
}

.circle {
  border-radius: 50%;
}

Example 2: border-radius circle using %

.circle {
    background-color:#fff;
    border:1px solid red;    
    height:100px;
    border-radius:50%;
    -moz-border-radius:50%;
    -webkit-border-radius:50%;
    width:100px;
}

Example 3: border radius css

border-radius: 5px; /* The corners will be round */

Example 4: negative border radius

.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: '';
}

Tags:

Misc Example