html - 在 CSS 中隐藏矩形形状的某些部分
问题描述
我想隐藏第二个矩形,宽度应该是 100% 并且响应迅速。我正在使用position: absolute;
& right:-10%
。我也试过body { max-width:100%; }
,但它不工作。你能解释一下为什么会发生这种情况以及如何解决这个问题吗?
.container2 {
position: absolute;
right: -10%;
width: 35vmax;
height: 90vmin;
background-image: linear-gradient(to bottom,hsl(293, 100%, 63%),hsl(264, 100%, 61%));
border-radius: 50% 50% 0% 0%;
}
<div class="container2"></div>
解决方案
你试过这个吗?
body {
overflow-x: hidden;
}
推荐阅读
- python - 通过 BeautifulSoup 从页面中获取 URL 列表和数据以及分页
- akeneo - Akeneo 中的产品资产和参考实体有什么区别?
- highcharts - 为类别 Highcharts 小部件中的任何元素创建链接
- php - 为什么我需要不断更新我的 Google 身份验证访问令牌?
- google-bigquery - BigQuery:如何根据轮班开始和结束时间查找一天中每个小时的工作员工数量
- javascript - How to set onkeypress or onkeydown only one time click?
- spring - Spring application on Tomcat configuration problem - error 404
- excel - How to create a unique identifier or equivalent to a dynamic table in Excel?
- angular - Why does angular tests fail sometimes?
- javascript - How can I take parameters from a url and append them to different tiles on the website?