利用css伪类编写冒泡小三角
HTML代码
<div class="lf otherLogin">
<span>其他方式注册</span>
<div class="otherItem clearfix">
<div class="lf qq">
<img src="./images/login_weibo.png" srcset="./images/login_weibo@2x.png 2x" alt="">
</div>
<div class="lf weibo">
<img src="./images/login_qq.png"srcset="./images/login_qq@2x.png 2x" alt="">
</div>
</div>
</div>
CSS代码
.otherLogin{
padding-left: 26px;
background: -webkit-image-set(url(./../images/login_other.png) 1x,url(./../images/login_other@2x.png) 2x) no-repeat left center;
background: -moz-image-set(url(./../images/login_other.png) 1x,url(./../images/login_other@2x.png) 2x) no-repeat left center;
background: -ms-image-set(url(./../images/login_other.png) 1x,url(./../images/login_other@2x.png) 2x) no-repeat left center;
background: -o-image-set(url(./../images/login_other.png) 1x,url(./../images/login_other@2x.png) 2x) no-repeat left center;
background: image-set(url(./../images/login_other.png) 1x,url(./../images/login_other@2x.png) 2x) no-repeat left center;
background-size: 16px 16px;
margin-left: 10px;
cursor: pointer;
position: relative;
}
.otherItem{
position: absolute;
top: 24px;
right: -76px;
}
.otherItem{
border:1px solid #DFDFDF;
border-radius: 4px;
display: none;
}
.otherLogin:hover .otherItem{
display: block;
}
.otherItem::before,.otherItem::after{
content: '';
position: absolute;
border: solid transparent;
width:0;
height:0;
}
.otherItem::after {
border-width: 5px;
border-right-color: #fff;
top: 10px;
left: -10px;
}
.otherItem::before{
border-width: 6px;
border-right-color: #DFDFDF;
top: 9px;
left:-13px;
}
最后效果图是:

CSS的伪类的作用还是很多的,可以试试,玩一下
利用css伪类编写冒泡小三角的更多相关文章
- 利用css制作带边框的小三角
标签(空格分隔):css 在项目中会使用到的小实例,目前知道的有两种方法来实现 设置元素的宽和高,利用rotate实现,比较简单的一种 div{ width: 10px; height: 10px; ...
- css直接写出小三角
在开发移动端项目时,总是遇到很多小三角,之前一直用图片,感觉好麻烦,今天尝试了直接用CSS写出小三角!先看看如何写出各种小三角! /*箭头向上*/ .arrow-up { ; ; border-lef ...
- 纯css写带小三角对话框
在实际样式中经常会遇到要写类似对话框的样式,而这种样式往往会有一个小三角,如下所示: 那么如何用css写出来呢,其实很简单,先让父元素相对定位,然后运用css的伪类before或after.就可以写个 ...
- 如何用css实线所需要的小三角
使用css实现三角符号 关于使用css制作三角符号,网上有很多的例子了,在这里只是为了详细的向各位解释一下三角符号的原理 下图,是一个长宽为100px,边框宽度为100px的一个元素,由此可见,在cs ...
- 利用css伪类选择器hover控制两个元素属性
示例1: <html> <body> <style> #a:hover {color : #FFFF00;} #a:hover > #b:first-chil ...
- 应用越来越广泛的css伪类
说起css伪类,学习web前端网页设计的同学们应该对此应该不是很陌生,以前很多的网页的特效大多是通过js来实现的.但是随着CSS3不断开发,利用css实现网页的特效不仅响应不错,而且还减少了很多的代码 ...
- 一个常见下拉菜单的样式:一体化小三角(纯css手写解决)
类似下拉菜单2个一体化小三角,习惯上用字体图标加jQuery处理,比较方便,但是下面纯css手写解决方式,效果也还不错,对CSS知识也是一个比较好的孔固. 小三角用了2种不同处理方式:1.利用bord ...
- CSS通过边框border-style来写小三角
<!DOCTYPE html> /*直接复制代码即可在浏览器验证*/ <html> <head lang="en"> <meta char ...
- 用CSS样式写选择框右侧小三角
直接上代码! <!DOCTYPE html><html lang="en"><head> <title>小三角</title& ...
随机推荐
- jdbc --- javabean
第一部分: javaBean 类 要和数据库表的字段一一对应 package com.ljs.bean; public class UserBean { private int id; privat ...
- Java NIO 读取文件、写入文件、读取写入混合
前言 Java NIO(new/inputstream outputstream)使用通道.缓冲来操作流,所以要深刻理解这些概念,尤其是,缓冲中的数据结构(当前位置(position).限制(limi ...
- haproxy实现会话保持
HAProxy系列文章:http://www.cnblogs.com/f-ck-need-u/p/7576137.html 1.反向代理为什么需要设置cookie 任何一个七层的http负载均衡器,都 ...
- 网上常用免费WebServices集合
天气预报Web服务,数据来源于中国气象局 公用事业http://www.webxml.com.cn/WebServices/WeatherWebService.asmx 中国股票行情分时走势预览缩略图 ...
- [knowledge] 停止等待协议
再读TCP/IP详解 说到流量控制, 可能便涉及了两方面 1. 停止等待协议. https://baike.baidu.com/item/%E5%81%9C%E6%AD%A2%E7%AD%89%E5% ...
- 把MP3保存到数据库中
使用JdbcUtils得到连接con java.sql包下的Interface Blob----其实现类SerialBlob Blob是一个可以存储二进制文件的容器. BLOB常常是数据库中用来存储二 ...
- 转:JAVA守护线程
原文地址:https://www.cnblogs.com/wxgblogs/p/5417503.html 详细内容看原文~ ,写的挺好的 在Java中有两类线程:User Thread(用户线程). ...
- # 20165225 《Java程序设计》第一周学习总结
20165225 <Java程序设计>第一周学习总结 1.视频与课本中的学习: 首先是为了运行和开发Java分别安装了JRE和JDK,具体做法在老师给的<Java2 实用教程(第五版 ...
- 数据库使用:sql server/mysql/sqlite
本科学过sql server数据库,上研刚开始在做研究时自己想点子自己做,为了简便使用了论文中看到的一个简易数据库sqlite存储使用数据.后来随着数据量的增长,以及数据处理的需求sqlite速度明显 ...
- 对线程发送signal
学习对线程 发送 signal #include <stdio.h> #include <stdlib.h> #include <string.h> #includ ...