HighDots Forums  

padding problem..

Cascading Style Sheets Layout/presentation on the WWW (comp.infosystems.www.authoring.stylesheets)


Discuss padding problem.. in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #11  
Old   
dorayme
 
Posts: n/a

Default Re: padding problem.. - 11-28-2007 , 02:42 PM






In article <slrnfkq87e.mmc.spamspam (AT) bowser (DOT) marioworld>,
Ben C <spamspam (AT) spam (DOT) eggs> wrote:

Quote:
On 2007-11-27, dorayme <doraymeRidThis (AT) optusnet (DOT) com.au> wrote:
[...]
Do you understand what I was saying about it being more than just
according to standards but common sense that padding will
increase height or width naturally and that height and width
specifications cannot be thought to be max height and width. On
this latter, here is another argument: suppose you tell an
element which from its natural content would be say 200px tall,
to be only 20px tall. What do you think should happen, what does
happen?

Unless it's a table cell, row or table, it should be exactly 20px tall
and the content overflows. Usually you can still see it, but only
because the overflow property is set to visible.

In other words, height instructions are not king. There
are other things that go on to temper and add and probably
subtract.

Apart from tables, you should always get exactly the height you ask
for (measured between the top and bottom inside-padding edges).
I was thinking too much about table cells, you are right. It was
misleading.

Heights are tricky customers in practice and there are some
delicious counter-intuitive things that are nice to look at and
get clear on:

http://tinyurl.com/272lfm

(this is not intended as any dispute with you or anyone, just a
reminder to myself to make up an easy to remember story to think
of these things as a hobby maybe over the Xmas break... <g> Just
btw, MacIE and no doubt WinIE 6 are a bit more intuitively what
you would expect on above url. I have not looked at Win, but
MacIE is a tiny clue to me.)

--
dorayme


Reply With Quote
  #12  
Old   
Ben C
 
Posts: n/a

Default Re: padding problem.. - 11-28-2007 , 04:12 PM






On 2007-11-28, dorayme <doraymeRidThis (AT) optusnet (DOT) com.au> wrote:
Quote:
In article <slrnfkq87e.mmc.spamspam (AT) bowser (DOT) marioworld>,
[...]
Heights are tricky customers in practice and there are some
delicious counter-intuitive things that are nice to look at and
get clear on:

http://tinyurl.com/272lfm

(this is not intended as any dispute with you or anyone, just a
reminder to myself to make up an easy to remember story to think
of these things as a hobby maybe over the Xmas break... <g> Just
btw, MacIE and no doubt WinIE 6 are a bit more intuitively what
you would expect on above url. I have not looked at Win, but
MacIE is a tiny clue to me.)
The thing about heights is that they are completely different from
widths.

Normal-flow auto width depends only on the container and is greedy.
Normal-flow auto height depends on the contents and is conservative.
This is a big difference.

Setting height explicitly is always going to be risky for any element
that has contents, because they might not fit. Setting width explicitly
is less risky because (in most cases) the contents will flow into the
space available and just take up a bit more height as a result.

Width is something a containing element dictates to its descendents
anyway (so it's mostly OK to set it explicitly), but height is the other
way round. The descendents determine how high the container needs to
be, and it's best advised to listen to them.


Reply With Quote
  #13  
Old   
dorayme
 
Posts: n/a

Default Re: padding problem.. - 11-28-2007 , 05:00 PM



In article <slrnfkrq11.mmc.spamspam (AT) bowser (DOT) marioworld>,
Ben C <spamspam (AT) spam (DOT) eggs> wrote:

Quote:
On 2007-11-28, dorayme <doraymeRidThis (AT) optusnet (DOT) com.au> wrote:
In article <slrnfkq87e.mmc.spamspam (AT) bowser (DOT) marioworld>,
[...]
Heights are tricky customers in practice and there are some
delicious counter-intuitive things that are nice to look at and
get clear on:

http://tinyurl.com/272lfm

(this is not intended as any dispute with you or anyone, just a
reminder to myself to make up an easy to remember story to think
of these things as a hobby maybe over the Xmas break... <g> Just
btw, MacIE and no doubt WinIE 6 are a bit more intuitively what
you would expect on above url. I have not looked at Win, but
MacIE is a tiny clue to me.)

The thing about heights is that they are completely different from
widths.

Normal-flow auto width depends only on the container and is greedy.
Normal-flow auto height depends on the contents and is conservative.
This is a big difference.

Yes. I take it that you mean that in, e.g., a <div>, the
container itself is not auto width shrink to fit content but is
auto height shrink to fit according to content.

It is shrink-to-fit its parent container in both width and
height, proving that what seems greedy from one point of view is
mere moderation from another (I mean it *could* have been, in
another possible world, not satisfied to stop at the inside of
the inside-padding of the parent...)

Quote:
Setting height explicitly is always going to be risky for any element
that has contents, because they might not fit. Setting width explicitly
is less risky because (in most cases) the contents will flow into the
space available and just take up a bit more height as a result.

Width is something a containing element dictates to its descendents
anyway (so it's mostly OK to set it explicitly), but height is the other
way round. The descendents determine how high the container needs to
be, and it's best advised to listen to them.
It is why I try to steer clear of heights in the wild [1].

--------------
[1] Or, to put it less charitably - I try hard to think like my
enemies in order to ennoble my soul through searing pain - I
can't cut it with the complexities as easily as I would dream.

--
dorayme


Reply With Quote
  #14  
Old   
Ben C
 
Posts: n/a

Default Re: padding problem.. - 11-29-2007 , 02:01 AM



On 2007-11-28, dorayme <doraymeRidThis (AT) optusnet (DOT) com.au> wrote:
Quote:
In article <slrnfkrq11.mmc.spamspam (AT) bowser (DOT) marioworld>,
Ben C <spamspam (AT) spam (DOT) eggs> wrote:
[...]
The thing about heights is that they are completely different from
widths.

Normal-flow auto width depends only on the container and is greedy.
Normal-flow auto height depends on the contents and is conservative.
This is a big difference.


Yes. I take it that you mean that in, e.g., a <div>, the
container itself is not auto width shrink to fit content but is
auto height shrink to fit according to content.
Yes, although technically the term "shrink-to-fit" (which they do use in
the specification) only applies to widths-- it means min(max(preferred
minimum width, available width), preferred width). There's nothing quite
like that for height. Contents have a height and that's it. There's no
such thing as "preferred minimum height" and available height plays no
part in the height calculation (unless the box is positioned).


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.