Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rounded Left Side CSS [closed]

Tags:

html

css

I'm currently trying to achieve the following effect with CSS, unfortunately my efforts have failed trying to modify code to get this even mildly right.

Any help would be greatly appreciated.

enter image description here

like image 706
JMKelley Avatar asked Apr 07 '17 10:04

JMKelley


People also ask

Which CSS properties can you use to create a rounded corner on just the top-left and top-right corners of an element?

The border-top-right-radius property defines the radius of the top-right corner. Tip: This property allow you to add rounded borders to elements!

Can I use CSS border-radius?

You can give any element “rounded corners” by applying a border-radius through CSS. You'll only notice if there is a color change involved. For instance, if the element has a background-color or border that is different than the element it's above.

How do you round the top-left corner in CSS?

The border-top-left-radius CSS property rounds the top-left corner of an element by specifying the radius (or the radius of the semi-major and semi-minor axes) of the ellipse defining the curvature of the corner.


1 Answers

You can use border-radiusonly on the two left corners and combine two values each, as in this example (you have to try around a bit to find a good combination):

.outer {
  width: 500px;
  background-color: #ddd;
  overflow: auto;
}
.outer img {
  float: right;
  border-top-left-radius: 30px 50%;
  border-bottom-left-radius: 30px 50%;
}
<div class="outer">
  <img src="http://placehold.it/200x400/fb3">
</div>
like image 140
Johannes Avatar answered Oct 25 '22 17:10

Johannes