利用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& ...
随机推荐
- Struts2 框架使用 核心以及其他详细配置
因为在使用SSH框架的过程,关于struts2的配置比较繁琐,所以做个总结. 一.导入并且关联其他XML 1. 因为在核心配置文件(Struts2.xml)中,如果存在很多需要配置的Action项 ...
- php之函数
scope(空间) unpack (解压) Traversable (穿越) performance(性能) experiment (检验) properties (属性) trailing (尾随) ...
- Page7:能控性、能观性及其判据和对偶原理(2)[Linear System Theory]
内容包含连续时间时变系统的能控性和能观测性判据,离散时间线性系统的能控性和能观测性判据,以及对偶原理
- JsLint 的安装和使用
JSLint 是一款Javascript验证工具,在定位错误并确保基本指南得以遵循时,非常有用.如果你正在编写专业级的javascript,应该使用 JSLint 或者类似的验证工具(JSHint). ...
- 适配ipad Pro
买了个新款ipad pro 11寸的,发现我们的ipad项目. 上下左右都有黑边 使用info.plist设置启动图,不用asset和launch storyboard 图片用如下格式命名,拖到项目中 ...
- oracle 监听报错the information provided for this listener is currently in use by other software on this computer
use another port number: the information provided for this listener is currently in use by other sof ...
- WIN7环境变量path误删(windows找不到文件‘%windir%\systempropertiesadvanced.exe’)的解决办法
一.进入安全模式 1.通过Ctrl+R打开运行窗口,输入Msconfig 2.如上图,选择安全引导,点击确定.重启计算机进入安全模式. 二.在安全模式下,设置环境变量 1.C:\Windows\Sys ...
- java常用工具所在的包
org.apache.commons.lang3:1)StringUtils.isBlank org.springframework.util:1)ResourceUtils.getFile(&quo ...
- Python开发【笔记】:抓包(实时分隔)
抓包 进行linux系统抓包,并且定时分隔防止文件太大 #!/usr/bin/env python # -*- coding:utf-8 -*- import os import sys import ...
- 洛谷P4363 一双木棋chess [九省联考2018] 搜索+hash
正解:记搜+hash 解题报告: 传送门! 因为看到nm范围特别小,,,所以直接考虑爆搜(bushi 先考虑爆搜之后再想优化什么的嘛QwQ 首先对这种都要最优的,就可以直接把答案设为针对某一方,然后题 ...