|
|
供参考:
- /* 梯形标签页基础样式 */
- .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");
- }
复制代码
|
|