div自适应宽度和高度实现

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>聊天模块开发</title>
<style type="text/css">

.send-right {
	position:relative;
	width:auto;
	//height:auto;
	//display:inline;  
	max-width:150px;
	background:#0099FF;
	border-radius:5px;
	padding:8px;
	word-wrap:break-word;
	float:right;
	margin-right:16px;
}

.send-right .arrow-right {
	position:absolute;
	top:5px;
	right:-16px;
	width:0;
	height:0;
	font-size:0;
	border:solid 8px;
	border-color:#FFFFFF #FFFFFF #FFFFFF #0099FF;
}

.send-left {
	position:relative;
	width:auto;
	//height:auto;
	//display:inline;  
	max-width:150px;
	background:#0099FF;
	border-radius:5px;
	padding:8px;
	word-wrap:break-word;
	float:left;
	margin-left:16px;
}

.send-left .arrow-left {
	position:absolute;
	top:5px;
	left:-16px;
	width:0;
	height:0;
	font-size:0;
	border:solid 8px;
	border-color:#FFFFFF #0099FF #FFFFFF #FFFFFF;
}

.content{
	vertival-align:middle;
	font-size:12px;
}

</style>
</head>
<body>
	<div>
		<div style="float:right;">
			<img style="width:30px;height:30px;" src="kefu1.png" />
		</div>
		<div class="send-right">
			<span class="content"><img style="width:100px;height:100px;" src="kefu1.png"/></span>
			<div class="arrow-right"></div>
		</div>
		<div style="clear:both"></div>   <!--清除浮动 -->
	</div>
	<br/>
	
	<div>
		<div style="float:right;">
			<img style="width:30px;height:30px;" src="kefu1.png" />
		</div>
		<div class="send-right">
			<span class="content">可扩展div功能实现</span>
			<div class="arrow-right"></div>
		</div>
		<div style="clear:both"></div>
	</div>
	<br/>

	<div>
		<div style="float:left;">
			<img style="width:30px;height:30px;" src="kefu1.png" />
		</div>
		<div class="send-left">
			<span class="content">可扩展div功能实现宽度变长</span>
			<div class="arrow-left"></div>
		</div>
		<div style="clear:both"></div>
	</div>
</body>
</html>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值