Robert Downes <nospamplease@see.my.signature.com> wrote:[color=blue]
>Steve Pugh wrote:[color=green]
>> Robert Downes <nospamplease@see.my.signature.com> wrote:
>>[color=darkred]
>>> p.actionLinkBlock {border: 1px #000000 dashed; padding: 0.2cm; width: auto}[/color]
>>
>> Oh. What do you expect cm to mean on screen? If I hold a ruler up to
>> my screen will your padding really be 0.2cm? Perhaps it's a typo and
>> you meant 0.2em?[/color]
>
>I'm using XFree86. The monitor display area is specified in the
>configuration, so DPI values can be calculated. More importantly,
>Mozilla offers a DPI calibrator, (although it does require getting out a
>tape-measure and measuring a rather-too-short line on the screen).[/color]
The DPI setting in Mozilla only worked on the *nix versions last I
checked, certainly changing it has never made any difference to the
display on my Windows.
[color=blue][color=green]
>> You need to read
http://www.w3.org/TR/CSS2/visudet.html#q6
>>
>> As you can see, your formulation means that width: auto; assigns the
>> full width of the parent minus border and padding.[/color]
>
>Read the section you pointed to. Even using the following:
>
>p.actionLinkBlock {background: #ffffff; width: auto; margin-right: auto;
>border-width: 0}
>
>I still get a box that extends to the right-edge of the screen. The
>browser must be seeing that both width and margin-right are auto, and
>giving width precedence, rather than making the margin as big as possible.[/color]
Yes, as that page says
"If 'width' is set to 'auto', any other 'auto' values become '0'"
and the initial value for width is always 'auto'.
[color=blue][color=green]
>> You need to set an explicit width, setting it in ems will allow you to
>> set it so that it adjusts to the size of the contained text.
>> Alternatively set explicit values for the margins and keep width:
>> auto;[/color]
>
>Explicit width is no good. I just want an automatically-determined
>minimum-width-necessary dashed border around the list of links. I find
>it hard to believe something as big as CSS 2 does not offer such a setting.[/color]
You can always use an inline element like <span> instead. If your link
text all fits on one line then everything will be fine, if not then
the padding will be a bit odd (but hey, if the text doesn't all fit on
one line then the width issue is moot).
display: table-cell; would also do what you want but isn't supported
by IE.
[color=blue][color=green]
>> Or you may be able to float it and omit the width. This is forbidden
>> in CSS2 but allowed in the proposed CSS2.1 and catered for by browser
>> bugs/features.[/color]
>
>CSS 2.1 is not in CR yet (still haven't worked out what that means), so
>Mozilla is pretty patchy on that front.[/color]
Most browsers have been 'shrink wrapping' floated elements with no
width for some time. All CSS 2.1 is going to do is standardise the
already widespread behaviour.
Steve
--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor
Steve Pugh <steve@pugh.net> <http://steve.pugh.net/>