<style>
.rounded {
height: 400px;
width: 300px;
background-color: #bbb;
border-top-left-radius: 50%;
border-top-right-radius: 50%;
display: inline-block;
}
</style>
<div class="rounded"></div>
提供上下边界半径将对其进行处理。
这样的东西对您有用吗?
<!DOCTYPE html><html lang="en"><head><title> Test Page </title>
<meta charset="UTF-8">
<meta name="viewport" content="width-device-width,initial-scale=1.0, user-scalable=yes"/>
<!-- Modified from 'heart' shape:
https://itnext.io/how-to-create-beautiful-shapes-in-css-a-teardown-of-3-shapes-purely-made-in-css-c3ac7cb99c4
-->
<style>
ul { list-style-type: none; cursor: pointer; }
.heart {
position: relative;
width: 200px;
height: 160px;
}
.heart:before,
.heart:after {
position: absolute;
content: "";
width: 200px;
height: 320px;
left: 100px;
background-color: tomato;
border-radius: 100px 100px 0 0;
/* transform: rotate(-45deg); */
transform-origin: 0 100%;
}
.heartMenu {
position: absolute;
left: 75px;
top: 75px;
z-index: 10;
}
</style>
</head><body>
<div id="heart" class="heart">
<ul class="heartMenu">
<li> Link 1 </li>
<li> Link 2 </li>
<li> Link 3 </li>
<li> Link 4 </li>
<li> Link 5 </li>
</ul>
</div>
<script>
</script>
</body></html>