当前位置: 首页 > news >正文

石基网站建设国内seo服务商

石基网站建设,国内seo服务商,wordpress商店如何,广州建筑集团官网首页效果展示 CSS 知识点 filter 属性回顾 transition 属性回顾 使用单选框实现导航菜单的思路 单选框当点击完成后就会有一个:checked属性&#xff0c;可以利用这个属性来实现导航菜单底部滑动块的滑动动画和当前菜单项激活状态的管理。 整体页面结构 <div class"tab…

效果展示

在这里插入图片描述

CSS 知识点

  • filter 属性回顾

  • transition 属性回顾

  • 使用单选框实现导航菜单的思路

    单选框当点击完成后就会有一个:checked属性,可以利用这个属性来实现导航菜单底部滑动块的滑动动画和当前菜单项激活状态的管理。

整体页面结构

<div class="tabs"><!-- 单选 --><input type="radio" id="home" name="tabsMenu" /><input type="radio" id="profile" name="tabsMenu" /><input type="radio" id="likes" name="tabsMenu" /><input type="radio" id="settings" name="tabsMenu" /><input type="radio" id="notifications" name="tabsMenu" /><!-- 图标 --><div class="buttons"><label for="home"><i class="fa-solid fa-house"></i></label><label for="profile"><i class="fa-solid fa-user"></i></label><label for="likes"><i class="fa-solid fa-heart"></i></label><label for="settings"><i class="fa-sharp fa-solid fa-gear"></i></label><label for="notifications"><i class="fa-solid fa-bell"></i></label><!-- 滑块 --><div class="underline"></div></div>
</div>

实现整体布局

.tabs input {visibility: hidden;display: none;
}.buttons {position: relative;display: flex;gap: 80px;padding: 30px 40px;border-bottom: 1px solid rgba(255, 255, 255, 0.2);background: #182d3c;overflow: hidden;border-radius: 20px;
}

编写菜单图标激活后的样式

.buttons label {width: 20%;font-size: 1.75em;-webkit-text-stroke: 1px #fff;color: transparent;cursor: pointer;transition: 0.5s;
}.buttons label:hover {opacity: 1;filter: drop-shadow(0 0 10px #fff) drop-shadow(0 0 20px #fff);
}/* 通过单选框激活状态,设置图标的激活状态 */
.tabs input:nth-child(1):checked ~ .buttons label:nth-child(1),
.tabs input:nth-child(2):checked ~ .buttons label:nth-child(2),
.tabs input:nth-child(3):checked ~ .buttons label:nth-child(3),
.tabs input:nth-child(4):checked ~ .buttons label:nth-child(4),
.tabs input:nth-child(5):checked ~ .buttons label:nth-child(5) {color: #fff;opacity: 1;filter: drop-shadow(0 0 10px #fff) drop-shadow(0 0 20px #fff);
}

实现菜单底部块的样式和移动样式

.underline {position: absolute;left: 0;bottom: 0;width: 20%;height: 5px;/* 设置滑块的移动时间 */transition: 0.5s;
}.underline::before {content: "";position: absolute;left: 50%;transform: translateX(-50%);width: 40px;height: 100%;background: #fff;filter: drop-shadow(0 0 10px #fff) drop-shadow(0 0 20px #fff) drop-shadow(0 0 30px #fff) drop-shadow(0 0 50px #fff);
}.underline::after {content: "";position: absolute;left: 50%;transform: translateX(-50%);width: 40px;height: 100%;background: #fff;filter: drop-shadow(0 0 10px #fff) drop-shadow(0 0 20px #fff) drop-shadow(0 0 30px #fff) drop-shadow(0 0 50px #fff) blur(5px);
}/* 通过单选框激活状态,设置滑块的移动距离 */
.tabs input:nth-child(1):checked ~ .buttons .underline {left: 0;
}.tabs input:nth-child(2):checked ~ .buttons .underline {left: 20%;
}.tabs input:nth-child(3):checked ~ .buttons .underline {left: 40%;
}.tabs input:nth-child(4):checked ~ .buttons .underline {left: 60%;
}.tabs input:nth-child(5):checked ~ .buttons .underline {left: 80%;
}

完整代码下载

完整代码下载

http://www.hengruixuexiao.com/news/5800.html

相关文章:

  • 关于拳馆网站建设计划书杭州推广公司
  • ppt超链接到网站怎么做seo关键词优化推荐
  • 公司注册网站源码网络竞价推广开户
  • 做零食网站怎么样sem竞价代运营公司
  • app网站建设制作百度seo策略
  • 河间网站制作bt磁力在线种子搜索神器下载
  • 郑州做网站第一人优化网站
  • 阳山做网站免费注册网页网址
  • wordpress菜谱网站如何广告推广
  • 门户网站开发分类aso关键词排名优化是什么
  • 网站建设需要什么基础怎么把网站排名排上去
  • 做外汇上什么网站看新闻网络营销课程速成班
  • 万户网站建设yy直播
  • 如何做餐饮的网站seo管理系统培训运营
  • 日本做的视频网站有哪些问题吗网站seo标题优化技巧
  • 顺德网站制作案例市场我是seo关键词
  • 网站收款即时到账怎么做的今日足球赛事分析推荐
  • 西安网站建设昆奇北京朝阳区
  • 带数字 网站 域名爱站小工具计算器
  • 广东网站建设哪家seo解释
  • 怎么代理传奇手游宁波seo网络推广定制多少钱
  • 郴州网站制作公司地址百度热议怎么上首页
  • 公司网站建设什么价格低上海seo推广整站
  • 网站建设hph下载广告传媒公司主要做什么
  • 来广营网站建设百度推广seo
  • 中国建设银行官网登陆seo是什么意思中文
  • 叶梓 wordpress 主题什么是seo教程
  • 企业网站建设文案案例使用 ahrefs 进行 seo 分析
  • 织梦网站如何备份教程山东网页定制
  • 网站建设公司发展历程百度搜索风云榜手机版