无忧启动论坛
标题:
求助CSS高手,代码修改
[打印本页]
作者:
proof
时间:
昨天 10:40
标题:
求助CSS高手,代码修改
CSS代码,仿Chrome标签页(梯形标签页),用于文件管理软件Tablacus Explorer。
显示效果:
1.PNG
(12.63 KB, 下载次数: 1)
下载附件
昨天 10:38
上传
想做些改进,主要是区分各个“非当前页”、完善梯形形状、自定义各种背景颜色,如图:
2.PNG
(23.05 KB, 下载次数: 0)
下载附件
昨天 10:38
上传
最终理想样式:
tab.png
(7.87 KB, 下载次数: 1)
下载附件
昨天 10:38
上传
CSS代码(待修改)
.tab, .tab2, .tab3,
.tab:hover, .tab2:hover, .tab3:hover {
box-shadow: none;
}
.tab0 {
padding: 3px 0 0 12px;
background-color: ActiveCaption;
}
.tab, .tab2, .tab3 {
position: relative;
background: transparent;
border: 0;
padding: 0 12px;
opacity: 1;
}
.activetab {
position: relative;
background-color: #fff;
border: 0;
padding: 0 2px;
margin: 0 10px;
height: 2em;
}
.activetab:before,
.activetab:after {
content: "";
position: absolute;
background-image: url("data:image/svg+xml;charset=utf8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill%3D%22%23fff%22%20d%3D%22M24%200C9%200%2015%2024%200%2024h25V0h-1z%22%2F%3E%3C%2Fsvg%3E");
bottom: 0;
width: 25px;
height: 24px;
}
.activetab:before {
left: -24px;
}
.activetab:after {
right: 1px;
transform: scaleX(-1);
transform-origin: right;
}
.tab:hover,
.tab2:hover,
.tab3:hover {
position: relative;
background-color: #d0e0e9;
border: 0;
padding: 0 2px;
margin: 0 10px;
}
.tab:hover:before,
.tab:hover:after,
.tab2:hover:before,
.tab2:hover:after,
.tab3:hover:before,
.tab3:hover:after {
content: "";
position: absolute;
background-image: url("data:image/svg+xml;charset=utf8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill%3D%22%23d0e0e9%22%20d%3D%22M24%200C9%200%2015%2024%200%2024h25V0h-1z%22%2F%3E%3C%2Fsvg%3E");
bottom: 0;
width: 25px;
height: 24px;
}
.tab:hover:before,
.tab2:hover:before,
.tab3:hover:before {
left: -24px;
}
.tab:hover:after,
.tab2:hover:after,
.tab3:hover:after {
right: 1px;
transform: scaleX(-1);
transform-origin: right;
}
复制代码
CSS代码源网页,有“仿Chrome标签页”和“仿FireFox标签页”两种代码,还有执行结果截图。
https://qiita.com/nocd5/items/af062f7b06d4cd3b8b18
https://tablacus.github.io/wiki/addons/usercss.html
作者:
a66
时间:
昨天 11:28
供参考:
/* 梯形标签页基础样式 */
.tab,
.tab2,
.tab3 {
position: relative;
display: inline-block;
background-color: transparent;
border: 0;
padding: 0 12px;
height: 2em;
line-height: 2em;
margin: 0 10px;
color: #333;
font-size: 13px;
user-select: none;
cursor: pointer;
z-index: 1;
}
/* 左右梯形边框 */
.tab:before, .tab:after,
.tab2:before, .tab2:after,
.tab3:before, .tab3:after {
content: "";
position: absolute;
bottom: 0;
width: 25px;
height: 24px;
background-size: 25px 24px;
}
/* 左侧梯形 */
.tab:before,
.tab2:before,
.tab3:before {
left: -24px;
}
/* 右侧梯形 */
.tab:after,
.tab2:after,
.tab3:after {
right: -1px;
transform: scaleX(-1);
transform-origin: right;
}
/* 当前页样式 */
.activetab {
background-color: #fff;
z-index: 2;
}
.activetab:before,
.activetab:after {
background-image: url("data:image/svg+xml;charset=utf8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill%3D%22%23fff%22%20d%3D%22M24%200C9%200%2015%2024%200%2024h25V0h-1z%22%2F%3E%3C%2Fsvg%3E");
}
/* 鼠标悬停样式 */
.tab:hover,
.tab2:hover,
.tab3:hover {
background-color: #d0e0e9;
z-index: 1;
}
.tab:hover:before, .tab:hover:after,
.tab2:hover:before, .tab2:hover:after,
.tab3:hover:before, .tab3:hover:after {
background-image: url("data:image/svg+xml;charset=utf8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill%3D%22%23d0e0e9%22%20d%3D%22M24%200C9%200%2015%2024%200%2024h25V0h-1z%22%2F%3E%3C%2Fsvg%3E");
}
/* 可选:支持不同背景颜色(通过类名) */
.tab.color1 {
background-color: #f5f5f5;
}
.tab.color1:before, .tab.color1:after {
background-image: url("data:image/svg+xml;charset=utf8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill%3D%22%23f5f5f5%22%20d%3D%22M24%200C9%200%2015%2024%200%2024h25V0h-1z%22%2F%3E%3C%2Fsvg%3E");
}
.tab.color2 {
background-color: #e0f7fa;
}
.tab.color2:before, .tab.color2:after {
background-image: url("data:image/svg+xml;charset=utf8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill%3D%22%23e0f7fa%22%20d%3D%22M24%200C9%200%2015%2024%200%2024h25V0h-1z%22%2F%3E%3C%2Fsvg%3E");
}
.tab.color3 {
background-color: #fff8e1;
}
.tab.color3:before, .tab.color3:after {
background-image: url("data:image/svg+xml;charset=utf8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill%3D%22%23fff8e1%22%20d%3D%22M24%200C9%200%2015%2024%200%2024h25V0h-1z%22%2F%3E%3C%2Fsvg%3E");
}
复制代码
作者:
guong
时间:
昨天 13:27
来学习下
作者:
肉仔
时间:
昨天 14:55
来看看
作者:
luoade
时间:
昨天 14:59
虽然看不懂但是还是要学习
作者:
ashchen
时间:
昨天 15:45
进来学习一下。话说这个用AI可以轻轻松松吧
作者:
misakayaho
时间:
昨天 16:21
学习一下
作者:
cc2025
时间:
昨天 17:11
感谢分享
作者:
longjiasand
时间:
昨天 17:13
AI经常搞不定。帮顶
欢迎光临 无忧启动论坛 (http://bbs.wuyou.net/)
Powered by Discuz! X3.3