常用--左边图片 右边内容

左图片,有内容排版

<!DOCTYPE html>
<html lang="zh">
<head>
	<meta charset="UTF-8" />
	<meta name="viewport" content="width=device-width, initial-scale=1.0" />
	<meta http-equiv="X-UA-Compatible" content="ie=edge" />
	<title>Document</title>
	<style>
		*{
			margin: 0;
			padding: 0;
		}
		.ell{
			display: inline-block;
		    padding: 0 4px;
		    text-overflow: ellipsis;
		    white-space: nowrap;
		    overflow: hidden;
		    vertical-align: middle;
		}
		.ell3{
			overflow:hidden;
			text-overflow: ellipsis;
			display:-webkit-box !important;
			-webkit-line-clamp:3;
			-webkit-box-orient:vertical;
		}
		.litembox{
			margin: 20px;
			width: 600px;
		}
		.litem{
			min-height: 50px;
			position: relative;
			padding: 10px;
			box-sizing: border-box;
			padding-left: 270px;
			min-height: 155px;
			border: 1px solid #ddd;
			margin-bottom: 10px;
		}
		.ileft{
			position: absolute;
			top: 10px;
			left: 10px;
		}
		.iright{
			position: relative;
			height: 135px;
		}
		.irightbox{
			position: relative;
			height: 100%;
		}
		.iright .icitem{
			position: relative;
			
		}
		.iright .icitem p{
			display: inline-block;
			width: 60%;
			text-align: justify;
		}
		.iright .icitem span{
			position: absolute;
			top: 2px;
			right: 0;
		}
		.iright .contentabslast{
			position: absolute;
		    bottom: 0;
		    width: 100%;
		}
		
	</style>
	<script src="jquery-3.1.1.min.js"></script>
</head>
<body>
	<div class="litembox">
		
	</div>
	
	<script>
		fun()
		function fun(){
			let shtml='';
			for(var i=0,len=5;i<len;i++){
		    	shtml+='<div class="litem">'
					+'		<div class="ileft">'
					+'			<img src="1.png" onerror=\'onerror=null;src="404.png"\' />'
					+'		</div>'
					+'		<div class="iright">'
					+'			<div class="irightbox">'
					+'				<div class="icitem contentabs"><p class="ell" title="内容">少熬夜 多运动 记得笑 少熬夜 多运动 记得笑</p><span>2019-12-23</span></div>'
					+'				<div class="icitem contentabs"><p class="ell3" title="内容">我是东,我来自南方,我不喜欢熬夜,我喜欢夜熬我,我不喜欢熬夜,我喜欢夜熬我,我不喜欢熬夜,我喜欢夜熬我</p></div>'
					+'				<div class="icitem contentabslast"><p></p><span>提交</span></div>'
					+'			</div>'
					+'		</div>'
					+'  </div>'
			}
			$('.litembox').html(shtml);
		}
		
	</script>
</body>
</html>

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值