CSS如何让一个div悬浮在另一个div上面

十点数据 1年前 ⋅ 6697 阅读

Div 浮动到另一个div之上:

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
	<title>绝对定位相对定位</title>
 	<style>
    	.fj1
    	{
        	position: absolute;
        	width: 150px;
        	height: 150px;
        	border: 1px solid #000;
        	background: #999;
    	}
    	.zj1
    	{
        	position: relative;
        	width: 100px;
        	height: 100px;
        	border: 1px solid #F00;
        	background: #FFF;
        	z-index: 1;
    	}
		</style>
	</head>
	<body>
 	<div>
    	<div class="fj1">
        我在下面 上的发生大幅 上的发生大幅随碟附送的
    	</div>
    	<div class="zj1">
        我浮动在上面</div>
	</div>
	</body>
</html>

最终实现的效果如下图所示,公众号图片显示在作者标签之上。

444444.jpg

全部评论: 0

    我有话说: