在使用第三方框架bootstrap的时候,本以为其是图片实现的小箭头,后来使用开发工具查看是用CSS来实现的,现记录如下:
理解完上面伪类的用法后,下面进入主题,直接贴上代码,
border test pagebody{background: #fff;}
.borderbottom{
width:0px;
height: 0px;
border-width: 8px;
border-style: solid;
border-color: transparent transparent #333 transparent;
position: absolute;
top: 10px;
}
.borderballoon{
width: 200px;
height: 80px;
background: lightgreen;
border-radius: 5px;
position: relative;
top: 30px;
}
.borderballoon:after{
content: "";
position: absolute;
border-style: solid;
border-color: lightgreen transparent transparent;
border-width: 10px;
bottom: -20px;
right:40px;
}
.flatballoon{
width: 200px;
height: 100px;
border: 1px solid #ccc;
border-radius: 5px;
position: relative;
top: 60px
}
.flatballoon:after{
content: "";
position: absolute;
border-style: solid;
border-color: #ccc transparent transparent;
border-width: 10px;
bottom: -20px;
right:40px;
}
.flatballoon:before{
content: "";
position: absolute;
border-style: solid;
border-color: white transparent transparent;
border-width: 10px;
bottom: -19px;
right:40px;
z-index: 9;
}
主要是定位结合伪类实现其效果。
css纯样式导航
纯CSS实现各类气球泡泡对话框效果
原文 纯CSS实现各类气球泡泡对话框效果 一.关于纯CSS实现气泡对话框 首先,来张大图: 上边这张黄黄的,大大的,圆圆的,有个小尾巴,文字内容有些YY的图片,就是使用纯CSS实现的气泡对话框效果,一 ...
纯css写带小三角对话框
在实际样式中经常会遇到要写类似对话框的样式,而这种样式往往会有一个小三角,如下所示: 那么如何用css写出来呢,其实很简单,先让父元素相对定位,然后运用css的伪类before或after.就可以写个 ...
纯CSS菜单样式,及其Shadow DOM,Json接口 实现
先声明,要看懂这篇博客要求你具备少量基础CSS知识, 当然如果你只是要用的话就随便了,不用了解任何知识 完整项目github链接:https://github.com/git-Code-Shelf/M ...
html css鼠标样式,鼠标形状
css鼠标手型cursor中hand与pointer Example:CSS鼠标手型效果
CSS常用样式及示例 一.简介 层叠样式表(英文全称:Cascading Style Sheets)是一种用来表现HTML(标准通用标记语言的一个应用)或XML(标准通用标记语言的一个子集) ...
VB.Net中点击按钮(Button)会重复提交两次表单
在VB.NET程序开发过程中遇到一个问题 提交一个表单时,button的html代码如下