css several important properties

A, Position attributes:
a predetermined type positioning elements:

1.static (default value) is not located

Elements appear in a normal flow (ignoring top, bottom, left, right or z-index statement).

2.absolute absolute positioning

Positioned relative to the parent element, elements position predetermined by top right bottom left attributes, not the location.

3.relative relative positioning

Positioned relative to its normal position to a fixed position with margin, representing the position.

4.fixed fixed positioning

Positioned relative to the browser window.

Two, z-index properties:

Set stacking order of elements, the element has a higher stacking order is always in front of the lower element.

Note: Z-index can only work on the positioning element can be negative.

Three, float property:

Floating elements, often applied to the image, the text surrounding the image. CSS, any element can float.

Clear float of common methods: 

clear: both: a last word element used to prevent collapse of the parent element height.

overflow: hidden: hide the excess

Four: after /: before selector:

After a further selected content element / front Inserts with the content attribute to specify the content to be inserted.

Five, dispaly property

1, inline-block: the block element row; width and height may be provided, and may be displayed in a row

2, none: the element will not be displayed.

3, block: the block elements to be displayed element, both before and after a line break.

4, inline: default; can not set the width and height.

 

Guess you like

Origin www.cnblogs.com/chengdu123/p/11523892.html