10-24.html

来自「一些css样式表的例子供大家学习和参考。」· HTML 代码 · 共 43 行

HTML
43
字号
<html>
<head>
<title>position属性</title>
<style type="text/css">
<!--
body{
	margin:10px;
	font-family:Arial;
	font-size:13px;
}
#father{
	background-color:#a0c8ff;
	border:1px dashed #000000;
	width:100%;
	height:100%;
	padding:5px;
}
#block1{
	background-color:#fff0ac;
	border:1px dashed #000000;
	padding:10px;
	position:absolute;		/* absolute绝对定位 */
	left:30px;
	top:35px;	
}
#block2{
	background-color:#ffbd76;
	border:1px dashed #000000;
	padding:10px;
	position:absolute;		/* absolute绝对定位 */
	left:50px;
	top:60px;	
}
-->
</style>
   </head>
<body>
	<div id="father">
		<div id="block1">block1</div>
		<div id="block2">block2</div>
	</div>
</body>
</html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?