简体   繁体   中英

How can i make a div's right height different from the left

The image below shows exactly what I want to do如您所见,右边的高度小于左边

I simply want to remake this div. But nothing I have tried is getting me that shape

Use path with curves ( C command)

  • Use this editor
  • see the below image for some idea about editor在此处输入图像描述
  • Idea from @marian150 's answer
     .rating-container { width: 90px; height:50px; background-color: red; clip-path: path('M 0 10 C 0 0 12.5 0 75 10 C 75 10 87.5 10 87.5 20 V 30 C 87.5 40 75 40 75 40 C 12.5 50 0 50 0 40 V 10'); display:table-cell; text-align:center; vertical-align:middle; }
     <div class='rating-container'> some abcd </div>

You can use CSS property clip-path.

Here is a sample code:

<div class='rating-container'>
</div>

.rating-container {
  width: 100px;
  height: 100px;
  background-color: red;
  clip-path: path('M 0 200 L 0,75 A 5,5 0,0,1 150,75 L 200 200 z');
}

This is not the shape you want, but just to show you an example.

You can also use online clip generators like https://be.nettfeely.com/clippy/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM