html - 如何创建没有重叠边框的导航栏?
问题描述
我想创建一个如下所示的导航栏:https ://www.audacityteam.org/
我试过这个,但我认为这看起来不对。缺口的边框不应该位于左右占位符的顶部。我也觉得我把这弄得太复杂了;这可以用更少的 div 元素来完成吗?
:root {
--background: black;
--accent: silver;
}
body {
margin: 0;
}
.placeholder {
float: left;
height: 20px;
width: 30%;
background: var(--background);
border-bottom: 3px solid var(--accent);
}
.right {
float: right;
}
.container {
position: absolute;
left: 25%;
border-top: 50px solid var(--background);
border-left: 50px solid transparent;
border-right: 50px solid transparent;
height: 0;
width: 40%;
}
.container-accent {
position: absolute;
left: 24.8%;
border-top: 53px solid var(--accent);
border-left: 53px solid transparent;
border-right: 53px solid transparent;
height: 0;
width: 40%;
transform: scale(1.008, 1.008);
}
<div class="placeholder"></div>
<div class="placeholder right"></div>
<div class="container-accent"></div>
<div class="container"></div>
解决方案
推荐阅读
- python - ImportError: No module named 'PyQt5.Qsci' [1016] 无法执行脚本接口
- typescript - 计算属性“解析错误:'}' 预计在”
- ionic4 - 如何在ionic4中加载带有弹出框的页面
- typescript - 带数字的联合类型 | 这是不能接受的吗?
- ios - 在 swift (ios) 中保存图像的最佳实践
- php - CSS不想包含在文件中
- c# - 从可执行文件中获取程序集
- java - 问题是 while 循环没有结束在 Java 中使用 system.in 获取输入段落
- javascript - 难以理解函数式编程组合、函子和单子示例
- recursion - Prolog递归基本案例