Home > Web Front-end > HTML Tutorial > Introducing the example code for positioning fixed in html

Introducing the example code for positioning fixed in html

零下一度
Release: 2017-04-28 14:52:34
Original
1769 people have browsed it

This article mainly introduces the positioning fixed example code in html. Students who are interested in html tutorials can refer to it.

<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>
Copy after login

The above is the detailed content of Introducing the example code for positioning fixed in html. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template