g8 Lesson 11
g8 Lesson 11
Visual Formatting
Dimension
• Dimension deals with the height and width of a box element. An element
can be resized by defining its height and width. The
Setting Max-Width and Max-Height
• CSS allows web developers to set the maximum and minimum width and
height of an element.
Setting Min-Width and Min-Height
• CSS also allows an element to set its maximum and minimum width and
height at the same time. It is beneficial since developers can estimate the
width or height instead of having a fixed size.
Position
• The position property specifies the kind of positioning that will be used for
an element.
• There are 4 positions
1. Static Position
2. Relative Position
3. Fixed Position
4. Absolute Position
Static
• Static is the default value. HTML elements are positioned static by default.
The diagram below shows how an element is positioned using static
property. Use property value position: static; to use static property values
Relative
• Relative behaves similarly to static unless you include additional properties.
Modifying the top, right, bottom, and left properties of this element will
cause it to be moved away from its normal position
• Example:
• div{ position: relative; top: -20px; left: 20px; }
Fixed