CSS-Lesson 12
Position
The position property can have one of four values:
- Static: This is the default value. It means that an element, text or image comes wherever it comes naturally within the flow of the page.
- Relative: This positions an element relative to where it would have been if had been static.
- Absolute: This positions an element in absolute position on the web page.
- Fixed: This positions an element in an absolute position in the browser window.
Note the distinction between absolute and fixed positioning.
Height
height
The height property can have one of the following four values:
- Size: see CSS-Lesson 4 for CSS size units.
- Percentage: This percentage is of the containing element.
- Auto: This default value means that the height of an element is big enough to contain its contents!
min-height
This property means that an element can be higher, but not shorter than the given value.
max-height
This property means that an element can shorter, but not higher than the given value.
Width
The properties width, min-width and max-width are defined in a similar way as height.
Positioning details
top, right, bottom, left
Elements can be positioned within their containing element by a pair of these properties, either top or bottom and either left or right.
z-index
Sometimes one element needs to be able cover up another element. Look at the drop down menus above. This done with a higher z-index.
float
The 'float' property can have the values 'left' or 'right'