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伪类编写冒泡小三角的更多相关文章

  1. 利用css制作带边框的小三角

    标签(空格分隔):css 在项目中会使用到的小实例,目前知道的有两种方法来实现 设置元素的宽和高,利用rotate实现,比较简单的一种 div{ width: 10px; height: 10px; ...

  2. css直接写出小三角

    在开发移动端项目时,总是遇到很多小三角,之前一直用图片,感觉好麻烦,今天尝试了直接用CSS写出小三角!先看看如何写出各种小三角! /*箭头向上*/ .arrow-up { ; ; border-lef ...

  3. 纯css写带小三角对话框

    在实际样式中经常会遇到要写类似对话框的样式,而这种样式往往会有一个小三角,如下所示: 那么如何用css写出来呢,其实很简单,先让父元素相对定位,然后运用css的伪类before或after.就可以写个 ...

  4. 如何用css实线所需要的小三角

    使用css实现三角符号 关于使用css制作三角符号,网上有很多的例子了,在这里只是为了详细的向各位解释一下三角符号的原理 下图,是一个长宽为100px,边框宽度为100px的一个元素,由此可见,在cs ...

  5. 利用css伪类选择器hover控制两个元素属性

    示例1: <html> <body> <style> #a:hover {color : #FFFF00;} #a:hover > #b:first-chil ...

  6. 应用越来越广泛的css伪类

    说起css伪类,学习web前端网页设计的同学们应该对此应该不是很陌生,以前很多的网页的特效大多是通过js来实现的.但是随着CSS3不断开发,利用css实现网页的特效不仅响应不错,而且还减少了很多的代码 ...

  7. 一个常见下拉菜单的样式:一体化小三角(纯css手写解决)

    类似下拉菜单2个一体化小三角,习惯上用字体图标加jQuery处理,比较方便,但是下面纯css手写解决方式,效果也还不错,对CSS知识也是一个比较好的孔固. 小三角用了2种不同处理方式:1.利用bord ...

  8. CSS通过边框border-style来写小三角

    <!DOCTYPE html> /*直接复制代码即可在浏览器验证*/ <html> <head lang="en"> <meta char ...

  9. 用CSS样式写选择框右侧小三角

    直接上代码! <!DOCTYPE html><html lang="en"><head> <title>小三角</title& ...

随机推荐

  1. authentication plugin caching_sha2

    操作系统:windows 10 mysql版本:mysql  Ver 8.0.11 for Win64 on x86_64 (MySQL Community Server - GPL) 安装完mysq ...

  2. 3-idiots hdu4609 母函数+FFT 组合数学题

    http://acm.hdu.edu.cn/showproblem.php?pid=4609 题意:1e5个数,求取三个数能形成三角形的概率. 题解(这怎么会是fft入门题QAQ): 概率的算法就是三 ...

  3. 一个1级分组基础上同时进行2级分组的SQL面试题

    示例1:测试数据: SQL> select * from score; ID CLASS STUDENT COURSE      SCORE ---------- ----- ------- - ...

  4. GatewayWorker

    GatewayWorker介绍 一.工作原理 Register.Gateway.BusinessWorker进程启动 Gateway.BusinessWorker进程启动后向Register服务进程发 ...

  5. MySQL数据类型之字符串类型

    CHAR(M) 分配固定长度的空间建(字节) VARCHAR(M)按照实际长度存储(占用的字节数是实际的长度加上1或者2)当M的值小于255时,加一.    当M的值大于255时,小于65532时,加 ...

  6. python发送邮件 大全汇总

    https://blog.csdn.net/bmxwm/article/details/79007871 参考菜鸟教程发送只有文字的邮件 1 2 3 4 5 6 7 8 9 10 11 12 13 1 ...

  7. Oracle 锁的等级

    ORACLE里锁有以下几种模式: 0:none 1:null 空 2:Row-S 行共享(RS):共享表锁,sub share 3:Row-X 行独占(RX):用于行的修改,sub exclusive ...

  8. Pandas之Dateframe 实现Excel读取与写入

    目的:有时需对数据进行到出到Excel,直观的给别人参阅,或从Excel中读取数据进行操作和分析依赖库 pandas 可简单的读出和写入 1,根据Excel读取( 需安装xlrd库) import n ...

  9. mysql存储引擎的简介

    前言 数据库存储引擎是数据库底层软件组织,数据库管理系统(DBMS)使用数据引擎进行创建.查询.更新和删除数据.不同的存储引擎提供不同的存储机制.索引技巧.锁定水平等功能,使用不同的存储引擎,还可以 ...

  10. Java如何循环数组并使用Split

    场景: 当写方法时遇到1个参数有3个值, 该参数类型为数组.    例如:  aaa|bbb|ccc  .  而且需要循环打印,这个时候我们就需要用数组循环输出的方法. 一:feature 示例 Wh ...