介绍html中定位fixed的实例代码

零下一度
零下一度 原创
2017-04-28 14:52:34 1366浏览

本篇文章主要介绍了html中定位fixed实例代码,对于html教程有兴趣的同学可以参考一下。

<html>
	<head>
		<title>123</title>
		<style>
			#sub1{
				width:50px;
				height:80px;
				border:1px solid #dcdcdc;
			}
			#sub2{
				position:fixed;
				top:250px;
				right:20px;
				width:50px;
				height:80px;
				border:1px solid #dcdcdc;
				margin-top:5px;
			}
			#sub3{
				width:250px;
				height:880px;
				border:1px solid #dcdcdc;
				margin-top:5px;
			}
		</style>
	</head>
	<body>
		<p id="parent">
			 <p id="sub1">sub1</p>
			 <p id="sub2">sub2</p>
			 <p id="sub3">sub1</p>
		</p>
	</body>
</html>

以上就是介绍html中定位fixed的实例代码的详细内容,更多请关注php中文网其它相关文章!

声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn核实处理。