Borders and More with Style Sheets - Clear Property
(Page 4 of 4 )
clear
IE 4 NN 4 Moz all Saf all Op all CSS 1
Inherited: No
Defines whether a block-level element allows itself to be displayed in the same horizontal band as a nearby floating element, such as an image. Typically, another element in the vicinity has its float style property set to left or right . To prevent the current element from being in the same band as the floating block, set the clear property to the same side ( left or right ). If you aren’t sure where the potential overlap might occur, set the clear property to both . An element with a clear property that is set to a value other than none is rendered at the beginning of the next available line below the floating element.
CSS Syntax
clear: both | left | none | right
Value Any of the following constants: both | left | none | right .
Initial Value none
Example
<img src="logo.gif" height="40" width="60" style="float: right">
<h1 style="clear: right">Giantco Corporation</h1>
Applies To Block-level elements.
Object Model Reference
[window.]document.getElementById("elementID").style.clear
clip
IE 4 NN 4 Moz all Saf all Op all CSS 2
Inherited: No
Defines a clipping region of a positionable element. The clipping region is the area of the element layer in which content is visible. If you encounter problems clipping an element, wrap the content-holding element inside a block-level element whose clip property is set to the desired region.
CSS Syntax
clip: rect(lengthTop lengthRight lengthBottom lengthLeft) | auto
Value
Extending to CSS2.1, the only shape recognized for the clip property is rect. Other shapes may be admitted in the future.
When specifying lengths for each side of the clipping rectangle, observe the clockwise order of values: top, right, bottom, left. See the discussion about length values at the beginning of this chapter. A value of auto sets the clipping region to the block that contains the content.
Initial Value auto
Example
<span style="position: absolute; clip: rect(10px 110px 80px 10px)">
<img src="desk1.gif" height="90" width="120">
</span>
Applies To Block-level, replaced, and positioned elements.
Object Model Reference
[window.]document.getElementById("elementID").style.clip
Please check back next week for the continuation of this article.
| DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware. |
|
This article is excerpted from chapter four of Dynamic HTML: The Definitive Reference, Third Edition, written by Danny Goodman (O'Reilly; ISBN: 0596527403). Check it out today at your favorite bookstore. Buy this book now.
|
|