|
Jan's CSS: PositionWith CSS you can position objects on the page without using a positioning table. You can force objects to overlap or place them side-by-side. It seems like an easy task, but it is a bit more complex than other CSS formatting. You must set several properties to ensure that your object is in just the right place. Method 1: FLOAT propertyAn element that floats allows text and images to wrap around the object. This method is commonly used for images but works with other elements, too. What you need:
Example: Float left and right ![]() ![]() Style code for floating: float:left; or float:right; Method 2: POSITION propertyWhat you need:
Styles for container for examples: Sets position, width, and height. position:relative; width:200px, height:200px;
Width and height for each green box is set in the class boxmodel in the internal style sheet for the page. The position, top, and left properties for each green box are set in an inline style. Examples: Position
Image of the results: More examples of CSS Positioning |