Positioning the various attributes CSS3

Location: position
static default setting coordinates are invalid
absolute absolute positioning
features:
1: from the normal flow, does not occupy the position
2: default reference html 00 point (browser zero)
3: If there is a parent, and the parent positioning, That reference parent element (excluding the default positioning) corresponds to the sub-element of the reference object specifies the
coordinate position:
horizontal left right
vertical top bottom

	relative: 相对定位
				特征:
				1: 占据文档流,占位置
				2: 参考自身加载在页面中的位置

	absolute	绝对定位
				1: 不占据位置,脱离文档流
				2: 默认参考html元素(浏览器)改变在页面中的位置,假如有定位父级,则参考父级元素
			
	fixed: 固定定位
				特征:
				1: 脱离文档流,不占位
				2: 元素固定在页面中不随着页面滚动而滚动
				3: 参考浏览器的00点
				
	sticky: 粘性定位
				特征:
				1: 页面达到一定高度时,脱离文档流
				2: 效果是吸附浏览器顶部

z-index: level;
positioning elements can modify the hierarchy

Published 10 original articles · won praise 1 · views 31

Guess you like

Origin blog.csdn.net/qq_46591632/article/details/105034501