html - 如何使div右上角裁剪
问题描述
我想做DIV
如下图:
请有人帮我实现这一目标
.div {
height: 200px;
background: blue;
border-radius: 4px;
border-top-right-radius: 40px;
}
<div class="div"></div>
注意:div 背景应该是白色的
解决方案
.tag-wrap {
height: 200px;
width: 500px;
background: #f7f7f7;
border-radius: 4px;
border-top-right-radius: 0;
border-left:10px solid blue;
border-top-left-radius: 10px;
border-bottom-left-radius: 10px;
filter: drop-shadow(3px 3px 3px rgba(50, 50, 0, 0.3));
}
.tag {
background: #fff;
height: 200px;
clip-path: polygon(0% 0%, 90% 0, 100% 30%, 100% 100%, 0% 100%);
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<div class="tag-wrap">
<div class="tag">
</div>
</div>
</body>
</html>
我已经用过clip-path
这个了。您可以使用以下链接生成剪辑路径!
仅供参考clip path
,box-shadow
不要一起工作,所以你必须遵守一些规则。这是参考链接
https://css-tricks.com/using-box-shadows-and-clip-path-together/
推荐阅读
- sql - SQL/Presto:如何在每个组的子组内排名
- swift - Swift-Linux-Glibc:错误:在范围内找不到类型“DIR”
- flutter - 仅当我单击项目时如何加载“扩展”内容
- php - 如何在 woocommerce 搜索结果中选择字段相关性?
- xcode - 在 Xcode Interface Builder 中关闭触控板触觉反馈?
- reactjs - 更新状态项的数量(React 和 useReducer)
- uber-api - 如何使用 API uberEats 获得客户的反馈?
- hash - 为什么哈希的长度总是16的倍数
- zooming - 带有笔记本电脑和显示器的 IEDriverServer
- lua - 有没有办法在 Nodemcu ESP8266 上的 LUA 中提高 SD 卡写入速度?