当前位置:网站首页>Relative positioning
Relative positioning
2022-07-27 13:21:00 【Sorry, this person doesn't exist】
Relative positioning
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style> .box1{
width: 200px; height: 200px; background-color: #bbffaa; } .box2{
width: 200px; height: 200px; background-color: orange; position:relative; left:200px; top:-200px; /* location (position) - Positioning is a more advanced means of layout - By positioning, you can place elements anywhere on the page - Use position Property to set the location Optional value : static The default value is , The element is the static beauty opening positioning relative Relative open elements absolute Open the fixed positioning of elements sticky Open the bonding and positioning of elements */ } .box3{
width: 200px; height: 200px; background-color: yellow; } </style>
</head>
<body>
<div class="box1"></div>
<div class="box2"></div>
<div class="box3"></div>
</body>
</html>
-- Relative positioning :
- When the element of position Property value set to relative It turns on the relative positioning of elements
- The characteristics of relative positioning :
1. After the relative positioning of the element is turned on , If the offset is not set, the element will not change
2. Relative positioning refers to the location of elements in the document stream
3. Relative positioning will raise the level of elements
4. Relative positioning doesn't take elements out of the document stream
5. Relative positioning does not change the nature of the element, block or block , In the industry or in the industry
- Offset (offfset)
- When element positioning is turned on , You can set the position of the element by the offset
top
- The distance between the positioning element and the upper edge of the positioning position
bottom
- The distance between the positioning element and the lower edge of the positioning position
- The vertical position of the positioning element is determined by top and bottom Two attributes to control
Usually we only use one of them
-top The bigger the value is. , Positioning elements go down
-bottom The bigger the value is. , The higher the positioning element goes
left
- The left distance between the positioning element and the positioning position
right
- The right distance between the positioning element and the positioning position
- The horizontal position of the positioning element is determined by left and right Two properties control , Usually only one... Will be used
-left The larger the element, the more to the right
-right The larger the element, the more to the left
边栏推荐
- CVPR22 | 关系意识的图神经架构搜索
- MySQL extensions
- v-show
- Baoli food listed on Shanghai Stock Exchange: annual revenue of 1.578 billion, market value of 5.8 billion
- 51:第五章:开发admin管理服务:4:开发【新增admin账号,接口】;(只开发了【用户名+密码的,方式】;【@T…】注解控制事务;设置cookie时,是否需要使用URLEncoder去编码;)
- Lambda expression
- 延迟队列DelayQueue性能测试
- Nodejs body parser middleware processes post form data of type multipart / form data, and req.body cannot receive data
- 二分法查询数组中的值
- About typora's inability to log in after March 9, 2022 -- resolved
猜你喜欢

Realize the disk partition and file system mount of the newly added hard disk

Open source project - taier1.2 release, new workflow, tenant binding simplification and other functions

18. Text processing tool -grep

视频游戏沉迷行为研究综述

QT excellent open source project 13: qscintilla

How can the top 500 enterprises improve their R & D efficiency? Let's see what industry experts say!

Seata 在蚂蚁国际银行业务的落地实践

力扣 1480. 一维数组的动态和 383. 赎金信412. Fizz Buzz

爱可可AI前沿推介(7.27)

AMD Adrenalin 22.7.1 驱动更新:OpenGL 性能翻倍,支持微软 Win11 22H2 系统
随机推荐
Lambda expression
Firefox 103 发布,更快、更安全
multi-table query
[nuxt 3] (XII) project directory structure 2
Initializing database error after reinstalling MySQL
Qt优秀开源项目之十三:QScintilla
初探基于OSG+OCC的CAD之任意多个子模型进行netgen以及gmsh网格划分
PG synchronizes multiple data tables to MySQL. Is there a way to simplify the configuration?
Mongodb slow query and index
POJ2594 Treasure Exploration【二分图最小路径覆盖】【Floyd】
Feign's overall process
文本样式
Poj1273 drainage ditches [maximum flow] [SAP]
实现新增加硬盘的磁盘分区和文件系统挂载
Jesd204b debugging notes (practical version)
v-show
592. Fraction addition and subtraction: introduction to expression calculation
How to get class objects
feign client三个客户端的自动装配
JS true / false array conversion