Programming css: how to write excellent code
Home
 
HORIZONTAL AND VERTICAL DIMENSION IN A CSS DOCUMENT

 

 

The horizontal dimensions of an absolutely positioned element are set with the properties left, margin-left, border-left-width, padding-left, width, padding-right, border-right-width, margin-right, and right. The values of these properties, when added together, must equal the width of the containing block. Negative margins may make the element wider than its containing block.

If the property left is set to auto in left-to-right languages, then the value is reset to be aligned with the same place where the element’s left edge would have been if it still were a part of the normal flow of the document (i.e., it had not been positioned). If that point is to the left of the left edge of the containing block, then left will be set to a negative value. In right-to-left languages, this rule is applied to the property right, not left page shifting - css ie6 .
If the property css decryption css code generators width is set to auto, then any auto values for the properties left and right are reset to 0. This will have the effect of marking the element and its margins as wide as the containing block.

If the properties left, right, or width are set to auto, then any auto values for the properties margin-left and margin-right are reset to 0. This will remove any left or right margins from the element. If the properties margin-left and margin-right are both set to auto, then they are set to be of equal widths. If the element’s width is set to an explicit length, then this will have the effect of "centering" the element within its containing block. (If the element’s width is not set to an explicit length, then it must be auto and the above rule will take effect, setting both margins to 0.

If there is only one property whose value remains auto (i.e., it is not reset by one of the previous rules), then it is reset to be the length necessary to satisfy the equation for calculating horizontal dimensions.
If all dimensions are set to explicit lengths, and these lengths do not add up to the width of the containing block, then in left-to-right languages the value of the property left is reset such that the equation for calculating horizontal dimensions will be satisfied. In right-to-left languages, it is the property right which is reset.

For replaced elements (e.g., images) which have been absolutely positioned, the rules differ from the ones just described in two ways. First, if the property width has a value of auto, replace it with the intrinsic width of the element. Second, since the value of the property width can never be auto, the third rule (listed previously) is effectively ignored. In addition, the width of an element can be bounded by the properties min-width and max-width.

The vertical dimensions of an absolutely positioned element are set with the properties top, margin-top, border-top-width, padding-top, height, padding-bottom, border-bottom-width, margin-bottom, and bottom. The values of these properties, when added together, must equal the height of the containing block. Negative margins may make the element taller than its containing block.
There are a number of rules which govern the adjustment of these property values. The rules for non-replaced elements (e.g., paragraphs) are set out in CSS2 as follows:
If the property top is set to auto, then the value is reset to be aligned with the same place where the element’s top edge would have been if it still were a part of the normal flow of the document (i.e., it had not been positioned). If that point is above the containing block, then top will be set to a negative value.

If either of the properties bottom or height are set to auto, then any auto values for the properties margin-top and margin-bottom are reset to 0. This will remove any top or bottom margins from the element.
If the properties margin-top and margin-bottom are both set to auto, then they are set to be of equal heights. If the element’s height is set to an explicit length, then this will have the effect of "vertically centering" the element within its containing block. (If the element’s height is not set to an explicit length, this means it is set to auto and the previous rule will take effect, setting both margins to 0.)

If there is only one property whose value remains auto (i.e., it is not reset by one of the previous rules), then it is reset to be the length necessary to satisfy the equation for calculating horizontal dimensions.
If all dimensions are set to explicit lengths, and these lengths do not add up to the height of the containing block, then the value of the property bottom is reset such that the equation for calculating horizontal dimensions will be satisfied.
For replaced elements (e.g., images) which have been absolutely positioned, the rules differ from the ones just described in two ways. First, if the property height has a value of auto, replace it with the intrinsic height of the element. Second, since the value of the property height can never be auto, the third rule (listed previously) is effectively ignored. In addition, the height of an element can be bounded by the properties min-height and max-height.

 

It may be that a user agent defines its own value for min-height. If so, then the user agent is free to reset any value for min-height which falls below its internal value. Note that under these rules, it is impossible to set a combination of property values which will cause an element to be just tall enough to contain its own content, and no taller (or shorter). This effect is sometimes called “shrink wrapping,” and its omission has been seen as a serious shortcoming in CSS2. To redress this situation, there have been proposed errata which change the meaning of height: auto to "make the element tall enough to display its own content."

These errata have not been formally adopted by the W3C, but they are supported by every known user agent which supports absolute positioning. As a basic example, assume for an absolutely positioned element that both margins and padding are set to 10 pixels in width, the borders have zero width, and the height of the positioned element is auto. Further assume that top is set to 0, and bottom is set to 100px. Now, further assume that the content is 260 pixels tall once it has been rendered. This will effectively set height to 260px. This means that the positioning context would have to be exactly 400 pixels tall in order to satisfy the equation for calculating vertical dimensions. If the positioning context is actually 475 pixels tall, then bottom will be reset to 175px.

Notbutik
Det största utbudet av noter - en svensk butik - allt på samma ställe! Alla smakinriktningar - Snabb service - Välkommen in och se!

Auto Transport
Getting Car shipping service is easy when you use this auto transport directory site for finding auto transporters. 

The Bali Villas, Private and Luxury Villa Provider in Bali
Reserving Bali private villas, luxury villas, and all Bali villas for holiday, vacation, and honeymoon. 

 

 

 

 

 

 

 

what are css

 



Copyright ADVANCED CSS WEB SOLUTIONS    |   All rights reserved