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. MySQL JDBC URL参数(转)

    MySQL的 JDBC URL格式: jdbc:mysql://[host][,failoverhost...][:port]/[database] » [?propertyName1][=prope ...

  2. searchIndexer.exe占用过高CPU

    1.searchIndexer.exe占用过高CPU很可能是Windows的索引损坏造成的. 这时候只要进入控制面板—索引选项—高级—重建即可解决 2. net stop "windows ...

  3. base64加解密字符串

    import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOExceptio ...

  4. 经常使用的android设计模式

    一般来说,经常使用的android设计模式有下面8种:单例.工厂.观察者.代理.命令.适配器.合成.訪问者.   单例模式:目的是为了让系统中仅仅有一个调用对象,缺点是单例使其它程序过分依赖它,并且不 ...

  5. System.AccessViolationException”类型的未经处理的异常在 System.Data.dll 中发生。其它信息:尝试读取或写入受保护的内存。这通常指示其它内存已损坏。

    错误背景: 操作系统:编程环境:VS2013.  语言:VB.net:  数据库:SQLserver2008 做数据库连接时.发生的错误: 错误提示为: 说明:用VB.net连接SQLServer数据 ...

  6. 蓝桥杯 地宫寻宝 带缓存的DFS

      历届试题 地宫取宝   时间限制:1.0s   内存限制:256.0MB      问题描写叙述 X 国王有一个地宫宝库. 是 n x m 个格子的矩阵. 每一个格子放一件宝贝. 每一个宝贝贴着价 ...

  7. hadoop(九) - hbase shell命令及Java接口

    一. shell命令 1. 进入hbase命令行  ./hbase shell 2. 显示hbase中的表  list 3. 创建user表,包括info.data两个列族 create 'user' ...

  8. poj 3263 Tallest Cow(线段树)

    Language: Default Tallest Cow Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 1964   Ac ...

  9. c# WinForm的一些问题

    工作中,用WinForm写了一段程序,刚开始运行正常,后来替换为公司框架的时候,发现原来用Label拼的表格控件,里面的Text无法显示,后来发现,父控件的ForColor为Control导致,子空间 ...

  10. js生成页面水印

    路: 获取想要插入水印的文档节点的顶点坐标值x,y. 获取文档节点的高度heigt和宽度width. 用div包裹文字来生成水印. 定义好div的长宽高间距等各种属性. 定义虚拟节点createDoc ...