css折叠的导航栏

embedded/2024/11/14 12:53:16/

导航栏点击多个的效果

<div class="cont"><!-- 第一个导航 --><div class="nav_a"><input type="checkbox" name="chk" id="chk1"><label for="chk1"><div class="plus"><img src="./images/plus.png" alt=""></div></label><div class="location"><img src="./images/location.png" alt=""></div><div class="message"><img src="./images/message.png" alt=""></div><div class="phone"><img src="./images/phone.png" alt=""></div><div class="share"><img src="./images/share.png" alt=""></div></div><!-- 第二个导航 --><div class="nav_b"><input type="checkbox" name="chk2" id="chk2"><label for="chk2"><div class="plus"><img src="./images/plus.png" alt=""></div></label><div class="location"><img src="./images/location.png" alt=""></div><div class="message"><img src="./images/message.png" alt=""></div><div class="phone"><img src="./images/phone.png" alt=""></div><div class="share"><img src="./images/share.png" alt=""></div><div class="location2"><img src="./images/location.png" alt=""></div><div class="message2"><img src="./images/message.png" alt=""></div></div><!-- 第三个导航 --><div class="nav_c"><input type="checkbox" name="chk3" id="chk3"><label for="chk3"><div class="plus"><img src="./images/plus.png" alt=""></div></label><div class="location3 icon"><img src="./images/location.png" alt=""></div><div class="message5 icon"><img src="./images/message.png" alt=""></div><div class="phone icon"><img src="./images/phone.png" alt=""></div><div class="share5 icon"><img src="./images/share.png" alt=""></div><div class="phone2 icon"><img src="./images/phone.png" alt=""></div><div class="message3 icon"><img src="./images/message.png" alt=""></div></div><!-- 第四个导航 --><div class="nav_d"><input type="checkbox" name="chk4" id="chk4"><label for="chk4"><div class="plus"><img src="./images/plus.png" alt=""></div></label><div class="location"><img src="./images/location.png" alt=""></div><div class="message"><img src="./images/message.png" alt=""></div><div class="phone"><img src="./images/phone.png" alt=""></div><div class="share"><img src="./images/share.png" alt=""></div></div><!-- 第五个导航 --><div class="nav_e"><input type="checkbox" name="chk5" id="chk5"><label for="chk5"><div class="plus"><img src="./images/plus.png" alt=""></div></label><div class="location"><img src="./images/location.png" alt=""></div><div class="message"><img src="./images/message.png" alt=""></div><div class="phone"><img src="./images/phone.png" alt=""></div><div class="share"><img src="./images/share.png" alt=""></div></div><!-- 第六个导航 --><div class="nav_f"><input type="checkbox" name="chk6" id="chk6"><label for="chk6"><div class="plus"><img src="./images/plus.png" alt=""></div></label><div class="location"><img src="./images/location.png" alt=""></div><div class="message"><img src="./images/message.png" alt=""></div><div class="phone"><img src="./images/phone.png" alt=""></div><div class="share"><img src="./images/share.png" alt=""></div></div></div>
css">
.cont {width: 810px;height: 578px;background-color: #eceff1;
}input {display: none;
}/* 第一个导航 */
.nav_a {width: 270px;height: 250px;float: left;
}.nav_a div {width: 50px;height: 50px;background-color: red;border-radius: 50%;text-align: center;line-height: 55px;position: absolute;top: 100px;left: 100px;transition: 1s;
}.nav_a .plus {z-index: 999;
}.nav_a img {width: 20px;height: 20px;
}.nav_a div:hover {transform: scale(1.2);
}.nav_a input[name="chk"]:checked~label>.plus {transform: rotate(45deg) scale(0.7);
}.nav_a input[name="chk"]:checked~.location {transform: translate(-80px, -70px) rotate(360deg);
}.nav_a input[name="chk"]:checked~.message {transform: translate(80px, -70px) rotate(360deg);
}.nav_a input[name="chk"]:checked~.phone {transform: translate(-80px, 70px) rotate(360deg);
}.nav_a input[name="chk"]:checked~.share {transform: translate(80px, 70px) rotate(360deg);
}/* 第二个导航 */
.nav_b {width: 270px;height: 250px;float: left;
}.nav_b div {width: 50px;height: 50px;background-color: red;border-radius: 50%;text-align: center;line-height: 55px;position: absolute;top: 100px;left: 370px;transition: 1s;
}.nav_b .plus {z-index: 999;
}.nav_b img {width: 20px;height: 20px;
}.nav_b div:hover {transform: scale(1.2);
}.nav_b input[name="chk2"]:checked~label>.plus {transform: rotate(45deg) scale(0.7);
}.nav_b input[name="chk2"]:checked~.location {transform: translate(-70px, -40px) rotate(360deg);
}.nav_b input[name="chk2"]:checked~.message {transform: translate(70px, -40px) rotate(360deg);
}.nav_b input[name="chk2"]:checked~.phone {transform: translate(-70px, 40px) rotate(360deg);
}.nav_b input[name="chk2"]:checked~.share {transform: translate(70px, 40px) rotate(360deg);
}.nav_b input[name="chk2"]:checked~.location2 {transform: translate(0px, -70px) rotate(360deg);
}.nav_b input[name="chk2"]:checked~.message2 {transform: translate(0px, 70px) rotate(360deg);
}/* 第三个导航 */
.nav_c {width: 270px;height: 250px;float: left;
}.nav_c .plus {width: 50px;height: 50px;background-color: red;border-radius: 50%;text-align: center;line-height: 55px;position: absolute;top: 100px;left: 650px;transition: 1s;
}.nav_c .icon {width: 50px;height: 50px;background-color: red;border-radius: 50%;text-align: center;line-height: 55px;position: absolute;top: 100px;left: 650px;transition: 1s;
}.nav_c .plus {z-index: 999;
}.nav_c img {width: 20px;height: 20px;
}.nav_c div:hover {transform: scale(1.2);
}.nav_c input[name="chk3"]:checked~label>.plus {transform: rotate(45deg) scale(0.7);
}.nav_c input[name="chk3"]:checked~.location3 {animation: location3 1s linear forwards;
}@keyframes location3 {0% {transform: translateY(-70px) rotate(0deg);}100% {transform: translateY(-70px) rotate(0deg);}
}.nav_c input[name="chk3"]:checked~.message5 {animation: message5 1s linear forwards;
}@keyframes message5 {0% {transform: translateY(-70px) rotate(0deg);transform-origin: 25px 95px;}100% {transform: translateY(-70px) rotate(180deg);transform-origin: 25px 95px;}
}.nav_c input[name="chk3"]:checked~.phone {animation: phone 1s linear forwards;
}@keyframes phone {0% {transform: translateY(-70px) rotate(0deg);transform-origin: 25px 95px;}100% {transform: translateY(-70px) rotate(125deg);transform-origin: 25px 95px;}
}.nav_c input[name="chk3"]:checked~.share5 {animation: share5 1s linear forwards;
}@keyframes share5 {0% {transform: translateY(-70px) rotate(0deg);transform-origin: 25px 95px;}100% {transform: translateY(-70px) rotate(60deg);transform-origin: 25px 95px;}
}.nav_c input[name="chk3"]:checked~.phone2 {animation: phone2 1s linear forwards;
}@keyframes phone2 {0% {transform: translateY(-70px) rotate(0deg);transform-origin: 25px 95px;}100% {transform: translateY(-70px) rotate(235deg);transform-origin: 25px 95px;}
}.nav_c input[name="chk3"]:checked~.message3 {animation: message3 1s linear forwards;
}@keyframes message3 {0% {transform: translateY(-70px) rotate(0deg);transform-origin: 25px 95px;}100% {transform: translateY(-70px) rotate(295deg);transform-origin: 25px 95px;}
}/* 第四个导航 */
.nav_d {width: 270px;height: 250px;float: left;
}.nav_d div {width: 50px;height: 50px;background-color: red;border-radius: 50%;text-align: center;line-height: 55px;position: absolute;top: 350px;left: 100px;transition: 1s;
}.nav_d .plus {z-index: 999;
}.nav_d img {width: 20px;height: 20px;
}.nav_d div:hover {transform: scale(1.2);
}.nav_d input[name="chk4"]:checked~label>.plus {transform: rotate(45deg) scale(0.7);
}.nav_d input[name="chk4"]:checked~.location {transform: translate(-100px, -60px) rotate(360deg);
}.nav_d input[name="chk4"]:checked~.message {transform: translate(-40px, -60px) rotate(360deg);
}.nav_d input[name="chk4"]:checked~.phone {transform: translate(20px, -60px) rotate(360deg);
}.nav_d input[name="chk4"]:checked~.share {transform: translate(80px, -60px) rotate(360deg);
}/* 第五个导航 */
.nav_e {width: 270px;height: 250px;float: left;
}.nav_e div {width: 50px;height: 50px;background-color: red;border-radius: 50%;text-align: center;line-height: 55px;position: absolute;top: 350px;left: 370px;transition: 1s;
}.nav_e .plus {z-index: 999;
}.nav_e img {width: 20px;height: 20px;
}.nav_e div:hover {transform: scale(1.2);
}.nav_e input[name="chk5"]:checked~label>.plus {transform: rotate(45deg) scale(0.9);
}.nav_e input[name="chk5"]:checked~.location {transform: translateX(-60px) rotate(360deg);
}.nav_e input[name="chk5"]:checked~.message {transform: translateX(-115px) rotate(360deg);
}.nav_e input[name="chk5"]:checked~.phone {transform: translateX(60px) rotate(360deg);
}.nav_e input[name="chk5"]:checked~.share {transform: translateX(115px) rotate(360deg);
}.message,.share{transition-delay: 0.5s;
}/* 第六个导航 */
.nav_f {width: 270px;height: 250px;float: left;
}.nav_f div {width: 50px;height: 50px;background-color: red;border-radius: 50%;text-align: center;line-height: 55px;position: absolute;top: 350px;left: 650px;transition:  1s;
}.nav_f .plus {z-index: 999;
}.nav_f img {width: 20px;height: 20px;
}.nav_f div:hover {transform: scale(1.2);
}.nav_f input[name="chk6"]:checked~label>.plus {transform: rotate(45deg) scale(0.9);
}.nav_f input[name="chk6"]:checked~.location {transform: translateX(-60px);
}.nav_f input[name="chk6"]:checked~.message {animation: message 0.5s linear forwards;
}@keyframes message {0% {transform: translateX(-60px);}100% {transform: translateX(-115px);}
}.nav_f input[name="chk6"]:checked~.phone {transform: translateX(60px);
}.nav_f input[name="chk6"]:checked~.share {animation: share 0.5s linear forwards;
}@keyframes share {0% {transform: translateX(60px);}100% {transform: translateX(115px);}
}

http://www.ppmy.cn/embedded/30230.html

相关文章

selinux 基础知识

目录 概念 作用 SELinux与传统的权限区别 SELinux工作原理 名词解释 主体&#xff08;Subject&#xff09; 目标&#xff08;Object&#xff09; 策略&#xff08;Policy&#xff09; 安全上下文&#xff08;Security Context&#xff09; 文件安全上下文查看 先启用…

SQLite如何处理CSV 虚拟表(三十七)

返回&#xff1a;SQLite—系列文章目录 上一篇&#xff1a;SQLite的DBSTAT 虚拟表&#xff08;三十六&#xff09; 下一篇:SQLite的扩展函数Carray()表值函数(三十八) ​ RFC4180格式是一种文本文件格式&#xff0c;被用于表格数据间的交互&#xff0c;也可将表格数据转化…

KVM安装Ubuntu24.04简要坑点以及优点

本机环境是ubuntu22.04的环境&#xff0c;然后是8核16线程 ssd是500的 目前对于虚拟机的选择&#xff0c;感觉kvm确实会更加流畅&#xff0c;最重要的一点是简洁&#xff0c;然后实际安装效果也比较的好&#xff0c;如果对于速度方面希望快一点&#xff0c;并且流畅一点的话这…

C#窗体控件DataGridView

目录 简介 基本框架 案例 案例1,往DataGridView中添加新列。 案例2&#xff0c;使用列名删除DataGridView中的某一列。 案例3&#xff0c;人手选中某一列&#xff0c;然后进行删除。 案例4&#xff0c;添加新的一行。 案例5&#xff0c;删除选中行。 案例6&#xff0c…

二分专题----如何优雅的写出二分

目录 一、如何编写二分 二、题目练习 1、二分查找----点击跳转题目 2、在排序数组中查找元素的第⼀个和最后⼀个位置 点击跳转题目 3、搜索插⼊位置----点击跳转题目 4、x的平⽅根----点击跳转题目 5、⼭峰数组的峰顶---点击跳转题目 6、寻找峰值----点击跳转题目 7、…

2024年Q1季度白酒行业数据分析:消费升级下,白酒均价上涨

前段时间&#xff0c;飞天茅台被曝批发参考价再次下探。而从线上市场的整体情况来看&#xff0c;白酒行业均价同比去年却有所上涨。鲸参谋数据显示&#xff0c;白酒均价在750元左右&#xff0c;同比去年上涨了14%。 尽管白酒行业均价有所上涨&#xff0c;但今年第一季度表现不…

LeetCode 238. 除自身以外数组的乘积

原题链接&#xff1a;. - 力扣&#xff08;LeetCode&#xff09; 给你一个整数数组 nums&#xff0c;返回 数组 answer &#xff0c;其中 answer[i] 等于 nums 中除 nums[i] 之外其余各元素的乘积 。 题目数据 保证 数组 nums之中任意元素的全部前缀元素和后缀的乘积都在 32…

【Kotlin】select简介

1 前言 协程的 select 是一种用于异步操作的选择器&#xff0c;它允许同时等待多个挂起函数的结果&#xff0c;并在其中一个完成时执行相应的操作。 能够被 select 的事件都是 SelectClause&#xff0c;在 select.kt 中有定义&#xff0c;如下。 public interface SelectBuild…