Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Custom rounded shape image using CSS

I want to get a custom-shape image as shown here:

rounded image

#oval-shape {
  width: 200px;
  height: 100px;
  background: blue;
  -moz-border-radius: 100px / 50px;
  -webkit-border-radius: 100px / 50px;
  border-radius: 100px / 50px;
}
<img id="oval-shape" src="http://d152j5tfobgaot.cloudfront.net/wp-content/uploads/2014/04/internship_yourstory.jpg">

DEMO

Any thoughts if this is even possible?

like image 776
Elaine Byene Avatar asked Jun 01 '16 20:06

Elaine Byene


1 Answers

There is one way you can "fake" this shape with border:

body {
  background: purple;
}
#oval-shape {
  display:block;
  margin: 20px auto;
  width: 200px;
  height: 200px;
  background: none;
  border-radius: 100%;
  box-sizing: border-box;
  border-bottom: 50px solid transparent;
}
<img src="http://d152j5tfobgaot.cloudfront.net/wp-content/uploads/2014/04/internship_yourstory.jpg" id="oval-shape">
like image 97
DaniP Avatar answered Nov 05 '22 00:11

DaniP