纯CSS3打造圆形菜单
原理是使用相对定位和绝对定位确定圆形菜单位置。
使用伪类选择器E:hover确定悬浮时候的效果,动画效果用CSS3的transition属性。
大概代码如下。
html:
<div id="at-plus-container">
<div id="bottom-positioner">
<div id="button">
<div id="info-bar">
<div style="display:block" class="info">
<ul>
<li title="2人参与讨论" class="page user"><img src="assets/images/people.png"><span>2</span></li>
<li title="3条评论" class="page comment"><img src="assets/images/comment.png"><span>3</span></li>
<li title="我有6条评论" class="mine posted"><img src="assets/images/post.png"><span>6</span></li>
<li title="被赞6次" class="mine like"><img src="assets/images/like.png"><span>6</span></li>
</ul>
</div>
</div>
<div id="control-ring-container">
<ul id="control-ring">
<li title="蒙板" class="mask button"></li>
<li title="历史记录" class="history button"></li>
<li title="消息" class="message button"><span class="unread">2</span></li>
<li title="设置" class="setting button"></li>
<li title="登录/注册" class="sign button"></li>
</ul>
</div>
<div class="apb">
<div class="icon"></div>
</div>
</div>
</div>
</div>
css3:
html,body {
text-align: center;
width: 100%;
height: 100%;
}
ul, li{
list-style-type: none;
}
#at-plus-container {
position: relative;
width: 150px;
height: 150px;
top:50%;
left: 40%;
}
#button {
width: 50px;
height: 50px;
}
#button {
position: relative;
width: 150px;
height: 150px;
}
.apb {
position: absolute;
top:50%;
left: 40%;
width: 25px;
height: 25px;
line-height: 50px;
background: ;
background: url("assets/images/atplus_white.png") rgba(3,3,3,0.5) no-repeat center;
background-size: 25px;
border-radius: 50%;
}
#button:hover .apb {
width: 50px;
height: 50px;
background: url("assets/images/atplus_green.png") rgba(3,3,3,0.5) no-repeat center;
background-size: 50px;
}
#info-bar {
opacity:;
border-radius: 50%;
}
#button:hover #info-bar{
opacity:;
background: rgba(3,3,3,0.5);
width: 100px;
height: 100px;
position: absolute;
margin:;
padding: 10px;
top: -50px;
left: 50px;
-webkit-transition: all 0.4s ease-in-out;
-moz-transition: all 0.4s ease-in-out;
-ms-transition: all 0.4s ease-in-out;
-o-transition: all 0.4s ease-in-out;
transition: all 0.4s ease-in-out;
}
.info {
position: absolute;
}
#button:hover .page {
position: absolute;
top:5px;
}
#button:hover .user {
left: 5px;
}
#button:hover .comment {
left: 55%;
}
#button:hover .mine {
left: 65%;
}
#button:hover .posted {
top: 25px;
}
#control-ring-container {
opacity:;
border-radius: 50%;
width: 130px;
height: 130px;
}
#button:hover #control-ring-container{
opacity:;
width: 130px;
height: 130px;
position: absolute;
margin:;
padding: 10px;
-webkit-transition: all 0.4s ease-in-out;
-moz-transition: all 0.4s ease-in-out;
-ms-transition: all 0.4s ease-in-out;
-o-transition: all 0.4s ease-in-out;
transition: all 0.4s ease-in-out;
}
.button {
border-radius: 50%;
}
#button:hover .button {
background: rgba(3,3,3,0.5);
width: 50px;
height: 50px;
position: absolute;
}
#button:hover .mask {
top: 15px;
left: 0px;
background: url("assets/images/mask.png") rgba(3,3,3,0.5) no-repeat center;
}
#button:hover .history {
top: 70px;
left: 5px;
background: url("assets/images/history.png") rgba(3,3,3,0.5) no-repeat center;
}
#button:hover .message {
top: 120px;
left: 20px;
background: url("assets/images/message.png") rgba(3,3,3,0.5) no-repeat center;
}
#button:hover .setting {
top: 130px;
left: 75px;
background: url("assets/images/setting.png") rgba(3,3,3,0.5) no-repeat center;
}
#button:hover .sign {
top: 80px;
left: 120px;
background: url("assets/images/signin.png") rgba(3,3,3,0.5) no-repeat center;
/*background-size: 50px;*/
}
纯CSS3打造圆形菜单的更多相关文章
- 【Web前沿技术】纯 CSS3 打造的10个精美加载进度条动画
之前向大家介绍8款优秀的 jQuery 加载动画和进度条插件,今天这篇文章向大家推荐10个纯 CSS3 代码实现精美加载进度条动画效果的方案.加载动画和进度条在网站和 Web 应用中的使用非常流行,特 ...
- 纯CSS3打造七巧板
原文:纯CSS3打造七巧板 最近项目上要制作一个七巧板,脑子里瞬间闪现,什么...七巧板不是小时候玩的吗... 七巧板的由来 先来个科普吧,是我在查资料过程中看到的,感觉很有意思. 宋朝有个叫黄伯思的 ...
- 纯css3打造瀑布流布局
纯css3打造瀑布流布局 原理: 1.column-count 把div中的文本分为多少列 2.column-width 规定列宽 3.column-gap 规定列间隙 4.break-inside: ...
- 纯CSS3打造非常炫的加载动画
纯css3打造的一款非常炫的加载图.用在需要一定时间加载的地方非常合适.先上效果图: 点击这里在线预览 代码非常简单.没有用任何javascript代码.纯css3实现. html代码: <di ...
- [原创]纯CSS3打造的3D翻页翻转特效
刚接触CSS3动画,心血来潮实现了一个心目中自己设计的翻页效果的3D动画,页面纯CSS3,目前只能在Chrome中玩,理论上可以支持Safari. 1. 新建HTML,代码如下(数据和翻页后的数据都是 ...
- 学用纯CSS3打造可折叠树状菜单
CSS执行顺序与优先权的问题其实就是一个冲突解决的问题,当同一个元素(或内容)被CSS选择符选中时,就要按照优先权取舍不同的CSS规则,这其中涉及到的问题其实很多.首先就是CSS规则的specific ...
- 移动端纯CSS3制作圆形进度条所遇到的问题
近日在开发的页面中,需要制作一个动态的圆形进度条,首先想到的是利用两个矩形,宽等于直径的一半,高等于直径,两个矩形利用浮动贴在一起,设置overflow:hidden属性,作为盒子,内部有一个与其宽高 ...
- 纯CSS3实现圆形进度条动画
悄悄地,GIF 格式的进度条已经越来越少,CSS 进度条如雨后春笋般涌现.今天要介绍的这个 CSS3 进度条,效果和 Flyme OS 4 上的加载动画一样. 首先,来看下最终的效果: 它的 HTML ...
- 纯CSS3垂直动画菜单
在线演示 本地下载
随机推荐
- vue 图片上传功能
这次做了vue页面的图片上传功能,不带裁剪功能的! 首先是html代码,在input框上添加change事件,如下: <ul class="clearfix"> ...
- Javascript-循环输出菱形,并可菱形自定义大小
var Cen = 6;//定义菱形中部为第几行(起始值为0) //for循环输出菱形 document.write("<button onclick='xh()'>点我for循 ...
- 玩转webpack之webpack的基本知识
相信看了gulp教程的小伙伴肯定都可以很容易的掌握gulp了.它已经没有什么可以值得去思考的东西了,如果你已经看懂它就是单纯的在布置任务,然后利用插件的功能去执行任务.最后发布任务,pipe的理念来和 ...
- ubuntu 安装 go 编译环境
参考: http://wiki.ubuntu.org.cn/Golang 从仓库安装(apt-get) sudo apt-get install golang 修改环境变量: vim /etc/env ...
- 数据库迁移工具DBMigration
- Python之路,Day3- Python基础(转载Alex)
本节内容 1. 函数基本语法及特性 2. 参数与局部变量 3. 返回值 嵌套函数 4.递归 5.匿名函数 6.函数式编程介绍 7.高阶函数 8.内置函数 温故知新 1. 集合 主要作用: 去重 关系测 ...
- windows 环境下搭建docker私有仓库
windows 环境下搭建docker私有仓库 1.在公用仓库中pull仓库镜像 docker pull regitry 2.启动仓库镜像 //-d意思是后台运行,-p是做端口映射,这里是将本地的50 ...
- Linux环境变量的种类
按环境变量的生存周期来划分,Linux的环境变量可分为两类: 1永久的:需要修改配置文件,变量永久生效. 2临时的:使用export命令行声明即可,变量在关闭shell时失效.
- 计蒜客 Flashing Fluorescents(状压DP)
You have nn lights, each with its own button, in a line. Pressing a light’s button will toggle that ...
- javaScript中的事件对象event是怎样
事件对象event,每当一个事件被触发的时候,就会随之产恒一个事件对象event,该对象中主要包含了关于该事件的基本属性,事件类型type(click.dbclick等值).目标元素target(我的 ...