1 案例

2. HTML 代码

<div class="arrow arrow-left-middle">
arrow-left-middle
</div>
<div class="arrow arrow-left-top">
arrow-left-top
</div>
<div class="arrow arrow-left-bottom">
arrow-left-bottom
</div>
<div class="arrow arrow-left-middle-move">
arrow-left-middle-move
</div>
<div class="arrow arrow-left-top-move">
arrow-left-top-move
</div>
<div class="arrow arrow-left-bottom-move">
arrow-left-bottom-move
</div>

3. CSS 代码

.arrow{
box-sizing: content-box;
border:;
margin:10px 0.5em;
cursor: pointer;
box-sizing: border-box;
display: inline-block;
color: #09f;
background: white;
padding: 10px 20px;
text-align: center;
/* 设置相对定位 */
position: relative;
transition: all 0.3s;
/* 设置层次 会被before after在上面 */
z-index:;
} /* 设置位置和border的颜色-需要与 4(4面) * 3(上中下) * 2(移动) = 24 */
.arrow-left-top:before,
.arrow-left-top-move:before,
.arrow-left-middle:before,
.arrow-left-middle-move:before,
.arrow-left-bottom:before,
.arrow-left-bottom-move:before{
transition: all 0.3s;
content: '';
border-style: solid;
width:;
height:;
display: block;
position: absolute;
margin:auto;
} .arrow-left-top:before,
.arrow-left-top-move:before,
.arrow-left-middle:before,
.arrow-left-middle-move:before,
.arrow-left-bottom:before,
.arrow-left-bottom-move:before{
border-width:0.5em 0.5em 0.5em 0;
border-color:transparent white transparent transparent;
} /* 中间 */
.arrow-left-middle-move:before,
.arrow-left-middle:before{
/* top 与 bottom 都为0 就会在中间 margin:auto; */
top:;
bottom:;
left:;
} /*顶部*/
.arrow-left-top:before,
.arrow-left-top-move:before{
top:;
left:;
} /*底部*/
.arrow-left-bottom:before,
.arrow-left-bottom-move:before{
bottom:;
left:;
} .arrow-left-middle-move:hover:before,
.arrow-left-top-move:hover:before,
.arrow-left-bottom-move:hover:before,
.arrow-left-middle:hover:before,
.arrow-right-middle-move:hover,
.arrow-left-top:hover:before,
.arrow-right-top-move:hover,
.arrow-right-bottom-move:hover,
.arrow-left-bottom:hover:before{
transform: translateX(-0.5em);
} .arrow-right-middle-move:hover:before,
.arrow-right-top-move:hover:before,
.arrow-right-bottom-move:hover:before,
.arrow-right-middle:hover:before,
.arrow-left-middle-move:hover,
.arrow-right-top:hover:before,
.arrow-left-top-move:hover,
.arrow-left-bottom-move:hover,
.arrow-right-bottom:hover:before{
transform: translateX(0.5em);
}

4 .练习

目前只是做了左边的效果。按照这种效果总共有24个。可以把css的类进行拆分并且把其他3面的写出来

CSS 按钮特效(二)的更多相关文章

  1. css 按钮悬停效霓虹灯特效

    css 按钮悬停效霓虹灯特效 <!DOCTYPE html> <html lang="en"> <head> <meta charset=

  2. js,jquery,css,html5特效

    包含js,jquery,css,html5特效,源代码 本文地址:http://www.cnblogs.com/roucheng/p/texiao.html 2017新年快乐特效 jQuery最新最全 ...

  3. ybutton 高端大气上档次华丽的按钮特效

    小菜偶然在某网站中看到一款非常华丽的按钮特效,感觉十分有必要抄袭下来,以备日后使用. 简单描述一下按钮的效果:鼠标移到按钮上的时候,会出现灯光闪过的效果,非常的高端. 但遗憾的,这么牛逼的效果,仅仅兼 ...

  4. 10个超漂亮的CSS 3D特效

    10个超漂亮的CSS 3D特效 一.总结 一句话总结: 后面有空得好好练一练,也可以作为录课素材 二.10个超漂亮的CSS 3D特效 转自或参考:10个超漂亮的CSS 3D特效https://blog ...

  5. CSS 按钮

    总结有关按钮的各种样式 ㈠基本按钮样式 看一下没有进行css样式设计时按钮的样子与进行样式设计的按钮样子 <!DOCTYPE html> <html> <head> ...

  6. 7款外观迷人的HTML5/CSS3 3D特效按钮特效

    下面我整理了7款外观都十分迷人的HTML5/CSS3 3D按钮特效,有几个还挺实用的,分享给大家. 1.CSS3超酷3D弹性按钮 按钮实现非常简单 之前我们分享过几款不错的CSS3 3D立体按钮,比如 ...

  7. 《基于JQuery和CSS的特效整理》系列分享专栏

    <基于JQuery和CSS的特效整理>已整理成PDF文档,点击可直接下载至本地查阅https://www.webfalse.com/read/201724.html 文章 一款基于jQue ...

  8. 漂亮的CSS按钮样式集以及在线生成工具

    以前我们制作一样带带阴影.圆角或3D感的按钮都需要用图片来制作,但CSS3出来后就可以不用图片了,由于是代码写的按钮样式,在Retina上浏览依然清晰美观.虽然不错,但我们写一个阴影+质感的按钮还是挺 ...

  9. 基于jQuery点击加载动画按钮特效

    分享一款基于jQuery点击加载动画按钮特效.这是一款基于jQuery+CSS3实现的鼠标点击按钮加载动画特效代码.效果图如下: 在线预览   源码下载 实现的代码. html代码: <div ...

随机推荐

  1. Ubuntu 16.04安装录屏软件SimpleScreenRecorder

    安装: sudo add-apt-repository ppa:maarten-baert/simplescreenrecorder sudo apt-get update sudo apt-get ...

  2. 【LeetCode-面试算法经典-Java实现】【067-Add Binary(二进制加法)】

    [067-Add Binary(二进制加法)] [LeetCode-面试算法经典-Java实现][全部题目文件夹索引] 原题 Given two binary strings, return thei ...

  3. hdu 5015 233 Matrix (矩阵高速幂)

    233 Matrix Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others) Tota ...

  4. C#如何编辑tab选项卡

    1 左侧的TabControl   2 如果要添加或删除选项卡个数,则定位到整个TabControl,然后编辑TabPages  

  5. git/svn里面的merge和rebase区别

    现在一般都用界面化的东西了,这种用法相近的命令行知不知道区别都可以.但是有些人喜欢研究,那么我来个传送门: 当我们用命令行操作git的时候,merge和rebase 有什么区别,请参考 https:/ ...

  6. Redis源代码分析(六)--- ziplist压缩列表

    ziplist和之前我解析过的adlist列表名字看上去的非常像.可是作用却全然不同.之前的adlist主要针对的是普通的数据链表操作. 而今天的ziplist指的是压缩链表.为什么叫压缩链表呢.由于 ...

  7. Android学习笔记(14):相对布局RelativeLayout

    相对布局RelativeLayout,继承自ViewGroup.相对布局的子组件的位置总是相对于兄弟组件或者父容器决定的. RelativeLayout支持的XML属性: android:gravit ...

  8. Credit Risk Scorecards Credit Risk Modeling 评分卡 KS AR

    https://cn.mathworks.com/help/finance/creditscorecard.validatemodel.html?requestedDomain=www.mathwor ...

  9. commons-fileupload 组件实现文件上传

    index.jsp 核心代码: //创建文件项工厂 DiskFileItemFactory factory = new DiskFileItemFactory(); //创建解析请求 数据的Servl ...

  10. sar 找出系统瓶颈的利器 目前Linux上最为全面的系统性能分析工具之一 直接 sar -dur 1 30 即可看内存 CPU和IO占用

    12. sar 找出系统瓶颈的利器 sar是System Activity Reporter(系统活动情况报告)的缩写.sar工具将对系统当前的状态进行取样,然后通过计算数据和比例来表达系统的当前运行 ...