<position> tags are used to position elements, that is, to define the position of the element
Relative positioning:
1 <! DOCTYPE html>2 3 4 <style type= "Text/css" >5 H2.left{6 position:relative;# relative used to generate relatively positioned elements7 Left:-20px;# Indicates a left offset of 20px relative to normal position8}9 H2.right{Ten position:relative;# relative used to generate relatively positioned elements One Left:20px;# Indicates a right offset of 20px relative to normal position A} - </style> - the - <body> - - +
- </body> +
Absolute positioning
1 <! DOCTYPE html>2 3 4 <style type= "Text/css" >5 H2{6 position:Absolute;# Absolute for generating absolutely positioned elements7 Left:100px;# Indicates the distance from the leftmost 100px8 Top:150px;# indicates the top 150px distance9}Ten </style> One A - <body> - the </body> -
DAY50--CSS positioning