html - 如何将div背景设置为椭圆形?
问题描述
我正在尝试将我的索引页 div 设置为椭圆形。我设法用边界半径做到了这一点,但问题是边缘太圆了,不像我预期的那样。
这是我的预期结果
CSS末尾的链接
<div class="home-page"></div>
.home-page {
z-index: 0;
display: grid;
grid-template-rows: 14vh max-content 18vh;
}
.home-page::before {
content:"";
position:absolute;
z-index:-1;
top:0;
left:0;
right:0;
bottom:0;
height: 83vh;
background-image: linear-gradient(215deg, #3f2b96, #a8c0ff);
border-bottom-left-radius: 50% 75px;
border-bottom-right-radius: 50% 75px;
}
解决方案
尝试添加边框半径 100% / 50%
推荐阅读
- notifications - 主页上的引导通知
- docker - 即使标签存在,在 docker composer 上也找不到清单
- android - espresso ActivityTestRule 用于具有泛型类型参数的活动
- php - .htaccess 不允许 $_GET 工作
- javascript - 自动备份 Google 表格而不复制附在表格上的表格
- java - 无法使用 Spring Boot 提供静态资源
- javascript - 关于如何使用 app.set() 和 app.get() 返回值
- angular - Typescript Angular 组件,冒号与等号
- api - 在哪里可以找到 Shutterstock API 的客户端 ID?
- c# - AES 解密消息与原始消息不匹配