CSS 气泡
来源:互联网 发布:部落冲突 地震数据 编辑:程序博客网 时间:2024/04/30 10:59
解析:
左布局案例:
头像,内容为 一行两列的Table div float在字体多的时候无法达到以上效果
内容的td里面 在分一个一行两列的左右布局
左边是左三角符号
右边是内容没有左上圆角的样式
头像对应的样式是tdtop
左右三角形分别对应left和right
左右内容样式分别是leftbubble 和rightbubble
三角符号的箭头位置代码
border-color: #f5f5f5 transparent transparent transparent;
border-color: transparent #f5f5f5 transparent transparent;
border-color: transparent transparent #f5f5f5 transparent;
border-color: transparent transparent transparent #f5f5f5
对应箭头上 右 下 左-自己测试去。。。。 ;
对应圆角弧度:
-moz-border-radius: 0px 15px 15px 15px;
-webkit-border-radius:0px 15px 15px 15px;
border-radius: 0px 15px 15px 15px;
写法与上面类似
3个属性对应不同浏览器
css 样式
<style type="text/css">
.leftbubble {
padding: 10px;
border: 2px solid #f5f5f5;
/*-moz-border-radius: 15px;
-webkit-border-radius: 15px;*/
border-radius: 0px 15px 15px 15px;
/* 这里以上是实现框框圆角化 */
position: relative;
background-color: #f5f5f5;
}
.rightbubble {
padding: 10px;
border: 2px solid #f5f5f5;
-moz-border-radius: 0px 15px 15px 15px;
-webkit-border-radius:0px 15px 15px 15px;
border-radius: 0px 15px 15px 15px;
/* 这里以上是实现框框圆角化 */
position: relative;
background-color: #f5f5f5;
}
.left {
position: relative;
right: -2px;
border-width: 10px;
border-style: solid dashed dashed dashed;
font-size: 0;
line-height: 0;
border-color: transparent #f5f5f5 transparent transparent;
}
.right {
position: relative;
left: -2px;
border-width: 10px;
border-style: solid dashed dashed dashed;
font-size: 0;
line-height: 0;
border-color: transparent transparent transparent #f5f5f5;
}
.tdtop {
vertical-align: top;
}
table{
border-collapse:collapse;
border-width:0px;
}
</style>
html
<div>
<table>
<tr>
<td class="tdtop">头像</td>
<td>
<table>
<tr>
<td class="tdtop"><div class="left"></div></td>
<td>
<div class="leftbubble">
//气泡框内容//气泡框内容//
</div>
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
<div>
<table style="float:right;">
<tr>
<td>
<table>
<tr>
<td>
<div class="rightbubble">
//气泡框内容//气泡框内容// //气泡框内容//气泡框内容// //气泡框内容//气泡框内容// //气泡框内容//气泡框内容// //气泡框内容//气泡框内容// //气泡框内容//气泡框内容// //气泡框内容//气泡框内容// //气泡框内容//气泡框内容// //气泡框内容//气泡框内容// //气泡框内容//气泡框内容// //气泡框内容//气泡框内容// //气泡框内容//气泡框内容// //气泡框内容//气泡框内容//
</div>
</td>
<td class="tdtop"><div class="right"></div></td>
</tr>
</table>
</td>
<td class="tdtop">
头像
</td>
</tr>
</table>
<div style="clear:both;"></div>
</div>
左布局案例:
头像,内容为 一行两列的Table div float在字体多的时候无法达到以上效果
内容的td里面 在分一个一行两列的左右布局
左边是左三角符号
右边是内容没有左上圆角的样式
头像对应的样式是tdtop
左右三角形分别对应left和right
左右内容样式分别是leftbubble 和rightbubble
三角符号的箭头位置代码
border-color: #f5f5f5 transparent transparent transparent;
border-color: transparent #f5f5f5 transparent transparent;
border-color: transparent transparent #f5f5f5 transparent;
border-color: transparent transparent transparent #f5f5f5
对应箭头上 右 下 左-自己测试去。。。。 ;
对应圆角弧度:
-moz-border-radius: 0px 15px 15px 15px;
-webkit-border-radius:0px 15px 15px 15px;
border-radius: 0px 15px 15px 15px;
写法与上面类似
3个属性对应不同浏览器
css 样式
<style type="text/css">
.leftbubble {
padding: 10px;
border: 2px solid #f5f5f5;
/*-moz-border-radius: 15px;
-webkit-border-radius: 15px;*/
border-radius: 0px 15px 15px 15px;
/* 这里以上是实现框框圆角化 */
position: relative;
background-color: #f5f5f5;
}
.rightbubble {
padding: 10px;
border: 2px solid #f5f5f5;
-moz-border-radius: 0px 15px 15px 15px;
-webkit-border-radius:0px 15px 15px 15px;
border-radius: 0px 15px 15px 15px;
/* 这里以上是实现框框圆角化 */
position: relative;
background-color: #f5f5f5;
}
.left {
position: relative;
right: -2px;
border-width: 10px;
border-style: solid dashed dashed dashed;
font-size: 0;
line-height: 0;
border-color: transparent #f5f5f5 transparent transparent;
}
.right {
position: relative;
left: -2px;
border-width: 10px;
border-style: solid dashed dashed dashed;
font-size: 0;
line-height: 0;
border-color: transparent transparent transparent #f5f5f5;
}
.tdtop {
vertical-align: top;
}
table{
border-collapse:collapse;
border-width:0px;
}
</style>
html
<div>
<table>
<tr>
<td class="tdtop">头像</td>
<td>
<table>
<tr>
<td class="tdtop"><div class="left"></div></td>
<td>
<div class="leftbubble">
//气泡框内容//气泡框内容//
</div>
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
<div>
<table style="float:right;">
<tr>
<td>
<table>
<tr>
<td>
<div class="rightbubble">
//气泡框内容//气泡框内容// //气泡框内容//气泡框内容// //气泡框内容//气泡框内容// //气泡框内容//气泡框内容// //气泡框内容//气泡框内容// //气泡框内容//气泡框内容// //气泡框内容//气泡框内容// //气泡框内容//气泡框内容// //气泡框内容//气泡框内容// //气泡框内容//气泡框内容// //气泡框内容//气泡框内容// //气泡框内容//气泡框内容// //气泡框内容//气泡框内容//
</div>
</td>
<td class="tdtop"><div class="right"></div></td>
</tr>
</table>
</td>
<td class="tdtop">
头像
</td>
</tr>
</table>
<div style="clear:both;"></div>
</div>
0 0
- CSS 气泡
- css实现气泡对话框
- 纯CSS箭头,气泡
- CSS气泡效果
- 纯CSS气泡效果
- css模拟气泡对话框
- 纯CSS气泡效果
- 纯CSS箭头,气泡
- 纯CSS气泡效果
- 纯CSS箭头,气泡
- 制作css气泡框
- 纯CSS气泡效果
- 制作CSS气泡框
- CSS 消息气泡实现
- 纯CSS实现气泡框
- css 气泡和手绘放大镜
- 纯CSS实现气泡框
- 利用css实现聊天气泡
- caffe日志输出tee命令
- [bzoj4006] [JLOI2015]管道连接
- 关于Linux中进入目录和在其下创建,显示文件所需权限,以及Atime,Ctime,Mtime和含义。
- Android studio 的安装全过程
- (集合)LinkedListTest1
- CSS 气泡
- STL总结
- java中Math类的数学计算功能
- java自学日记 day18
- 记录心情低落的一天
- 稀疏表示与字典学习基础介绍及代码
- Axure之实现页面的左右切换简单实例
- Stack(篇3)设计一个栈能够在O(1)的时间内getMin
- CSDN如何快速转载别人的文章