CSS position fixed left and right double positioning implementation code

CSS position fixed left and right double positioning implementation code

CSS Position
The position attribute specifies the positioning type of an element.

The position property has five values:

  • static
  • relative
  • fixed
  • absolute
  • sticky

Elements can be positioned using the top, bottom, left and right properties. However, these properties will not work unless the position property is set first. They also work differently, depending on the positioning method.

<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<style>
			.box{
				width: 1400px;
				height: 1500px;
				margin: 0 auto;
			}
			.box1{
				border: 1px solid #000000;
				height: 200px;
				width: 200px;
			    display: inline-block;
				position: fixed;
		
			}
			.box02{
				    border: 1px solid #006400;
				    height: 1500px;
				    width: 800px;
				    display: inline-block;
				    margin: 0 20px;
				    margin-left: 250px;
			}
			.box03{
				border: 1px solid #006400;
				height: 200px;
				width: 200px;
				display: inline-block;
			    position: fixed;
			}
		</style>
	</head>
	<body>
		<div class="box">
			<div class="box1">123</div>
			<div class="box02">456</div>
			<div class="box03">789</div>
		</div>
	</body>
</html> 

insert image description here

This is the end of this article about the implementation code of CSS position fixed left and right double positioning. For more relevant CSS position fixed positioning content, please search 123WORDPRESS.COM’s previous articles or continue to browse the following related articles. I hope everyone will support 123WORDPRESS.COM in the future!

<<:  How to prevent Vue from flashing in small projects

>>:  Implementation code of front-end HTML skin changing function

Recommend

MySQL configuration SSL master-slave replication

MySQL5.6 How to create SSL files Official documen...

Installation and configuration tutorial of MySQL 8.0.16 under Win10

1. Unzip MySQL 8.0.16 The dada folder and my.ini ...

vue-pdf realizes online file preview

This article example shares the specific code of ...

Where is mysql data stored?

MySQL database storage location: 1. If MySQL uses...

JavaScript implements circular progress bar effect

This article example shares the specific code of ...

Use and optimization of MySQL COUNT function

Table of contents What does the COUNT function do...

How to implement Ajax concurrent request control based on JS

Table of contents Preface Ajax serial and paralle...

js implements shopping cart addition and subtraction and price calculation

This article example shares the specific code of ...

MySQL database case sensitivity issue

In MySQL, databases correspond to directories wit...

How to use Vue cache function

Table of contents Cache function in vue2 Transfor...

How to use nginx to block a specified interface (URL)

1. Introduction Sometimes, after the web platform...

Tutorial diagram of using Jenkins for automated deployment under Windows

Today we will talk about how to use Jenkins+power...

Things You Don’t Know About the CSS ::before and ::after Pseudo-Elements

CSS has two pseudo-classes that are not commonly ...

HTML table markup tutorial (37): background image attribute BACKGROUND

Set the background image for the table header. Yo...