![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hello. I observed something strange in Firefox which let me study precisely the section 10.3.7 of the specifications of CSS2 and I have a question about it. The specifications refer to a special value "static-position" which is defined as the value a hypothetical box would have when positionned with "static" argument. But the position of such a hypothetical box depends on some properties of the hypothetical box : for example, is this box displayed inline or as a block ? |
|
Has it a null width ? |
#3
| |||
| |||
|
|
Hello. I observed something strange in Firefox which let me study precisely the section 10.3.7 of the specifications of CSS2 and I have a question about it. The specifications refer to a special value "static-position" which is defined as the value a hypothetical box would have when positionned with "static" argument. |
|
But the position of such a hypothetical box depends on some properties of the hypothetical box : for example, is this box displayed inline or as a block ? Has it a null width ? |
does not take
#4
| |||
| |||
|
|
Sylvain Chevillard wrote: Hello. I observed something strange in Firefox which let me study precisely the section 10.3.7 of the specifications of CSS2 and I have a question about it. The specifications refer to a special value "static-position" which is defined as the value a hypothetical box would have when positionned with "static" argument. Not an accurate quote at all. This is it: The term "static position" (of an element) refers, roughly, to the position an element would have had in the normal flow. Your hypothetical static box cannot be positioned. It does not take positioning properties (top, left, right, bottom). Your static box will always be in "flow" - as if no CSS were used. But the position of such a hypothetical box depends on some properties of the hypothetical box : for example, is this box displayed inline or as a block ? Has it a null width ? Again, a static box cannot be positioned - it does not take positioning properties. A static block initially is a block and as such takes dimension |
takes dimension|
properties (width, height). If none is given, then it has the full width of the container, even if its inherent width is less. A static block defined as inline (display:inline does not takedimension properties. It has the element's inherent width (such as text). If none, then it is none. |
#5
| |||
| |||
|
#6
| |||
| |||
|
|
Thank you both for your answers. Gus Richter: when I said "positionned with static argument", I meant "positionned by the user agent" not by a CSS left or right argument. I was not clear about it. Please excuse me. Ben C has understood my thought and pretty well answered. Ben C: there is another time where the width affects the position of an element in the flow, and that is the situation I encountered. If your element is in a text-align:center environment, and if its actual computed width is w and the center of the parent block is c, the left edge of the element will be c-w/2. |
|
My personal understanding of the idea behind the specifications is that an element with position:absolute and no left/right indication should be horizontally positionned as if it were in the normal flow. This lets you for example position an element absolutely vertically but let it stay in the normal flow horizontally. With that understanding of the specifications, it is clear that the hypothetical box should have the same computed width that my element, so my absolutely positionned element would keep centered in the page. Do you agree with my opinion ? |
![]() |
| Thread Tools | |
| Display Modes | |
| |