无忧启动论坛

 找回密码
 注册
搜索

求助CSS高手,代码修改

查看数: 604 | 评论数: 10 | 收藏 1
关灯 | 提示:支持键盘翻页<-左 右->
    组图打开中,请稍候......
发布时间: 2025-11-19 10:40

正文摘要:

CSS代码,仿Chrome标签页(梯形标签页),用于文件管理软件Tablacus Explorer。显示效果: CSS代码(待修改) .tab, .tab2, .tab3, .tab:hover, .tab2:hover, .tab3:hover {   box-shadow: none; ...

回复

wsdhgd 发表于 昨天 16:22
好久没有用css了,学习一下
剑转流云 发表于 昨天 15:48
观摩学一下
longjiasand 发表于 前天 17:13
AI经常搞不定。帮顶
cc2025 发表于 前天 17:11
感谢分享
misakayaho 发表于 前天 16:21
学习一下
ashchen 发表于 前天 15:45
进来学习一下。话说这个用AI可以轻轻松松吧
luoade 发表于 前天 14:59
虽然看不懂但是还是要学习
肉仔 发表于 前天 14:55
来看看
guong 发表于 前天 13:27
来学习下
a66 发表于 前天 11:28
供参考:

  1. /* 梯形标签页基础样式 */
  2. .tab,
  3. .tab2,
  4. .tab3 {
  5.   position: relative;
  6.   display: inline-block;
  7.   background-color: transparent;
  8.   border: 0;
  9.   padding: 0 12px;
  10.   height: 2em;
  11.   line-height: 2em;
  12.   margin: 0 10px;
  13.   color: #333;
  14.   font-size: 13px;
  15.   user-select: none;
  16.   cursor: pointer;
  17.   z-index: 1;
  18. }

  19. /* 左右梯形边框 */
  20. .tab:before, .tab:after,
  21. .tab2:before, .tab2:after,
  22. .tab3:before, .tab3:after {
  23.   content: "";
  24.   position: absolute;
  25.   bottom: 0;
  26.   width: 25px;
  27.   height: 24px;
  28.   background-size: 25px 24px;
  29. }

  30. /* 左侧梯形 */
  31. .tab:before,
  32. .tab2:before,
  33. .tab3:before {
  34.   left: -24px;
  35. }

  36. /* 右侧梯形 */
  37. .tab:after,
  38. .tab2:after,
  39. .tab3:after {
  40.   right: -1px;
  41.   transform: scaleX(-1);
  42.   transform-origin: right;
  43. }

  44. /* 当前页样式 */
  45. .activetab {
  46.   background-color: #fff;
  47.   z-index: 2;
  48. }

  49. .activetab:before,
  50. .activetab:after {
  51.   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");
  52. }

  53. /* 鼠标悬停样式 */
  54. .tab:hover,
  55. .tab2:hover,
  56. .tab3:hover {
  57.   background-color: #d0e0e9;
  58.   z-index: 1;
  59. }

  60. .tab:hover:before, .tab:hover:after,
  61. .tab2:hover:before, .tab2:hover:after,
  62. .tab3:hover:before, .tab3:hover:after {
  63.   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");
  64. }

  65. /* 可选:支持不同背景颜色(通过类名) */
  66. .tab.color1 {
  67.   background-color: #f5f5f5;
  68. }
  69. .tab.color1:before, .tab.color1:after {
  70.   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");
  71. }

  72. .tab.color2 {
  73.   background-color: #e0f7fa;
  74. }
  75. .tab.color2:before, .tab.color2:after {
  76.   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");
  77. }

  78. .tab.color3 {
  79.   background-color: #fff8e1;
  80. }
  81. .tab.color3:before, .tab.color3:after {
  82.   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");
  83. }
复制代码



小黑屋|手机版|Archiver|捐助支持|无忧启动 ( 闽ICP备05002490号-1 )

闽公网安备 35020302032614号

GMT+8, 2025-11-21 06:23

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表