CSS Not What I Thought It Would Be

Discussion in 'HTML' started by Tim Milstead, Mar 3, 2006.

  1. Tim Milstead

    Tim Milstead Guest

    In principle I like the idea of CSS. I want my content to be separate
    from my formatting, but my experience of CSS is not a good one.

    I guess it is not a criticism of CSS itself to say that different
    browser implementations and levels of support are a pain, but there
    comes a point when one has to take a pragmatic rather than idealistic
    decision to ditch something right for something that works.

    I also have a guilty secret - I miss tables. I know it's wrong but
    things were so much easier back then...

    Here are two things I find difficult in CSS.

    1. The width of an object being width+margin+border+padding as opposed
    to being just the width property! Suppose I want two columns one 25%
    wide the other 75% wide. I want each column to have a margin of 5px a
    1px border and padding of another 5px. I would like to do all this with
    just two divs but I can't because the margin, border and padding make
    the columns wider than 25% and 75% which means they appear under each
    other. There appears to be no way of subtracting the 11px round the
    edges off the percentage width of the column (an expression in my css).

    I have done something wrong?

    2. I find that I just end up having to add divs to get the layout right
    which means that my document now contains formatting instructions mixed
    with its content - exactly what CSS was meant to avoid.

    It seems that JSP and XML with translation are the only ways to keep the
    layout separate. Neither of these are particularly handy for simple web
    page creation and hosting.

    What do people think?

    Tim.
    Tim Milstead, Mar 3, 2006
    #1
    1. Advertising

  2. On Fri, 03 Mar 2006 11:04:39 +0100, Tim Milstead
    <> wrote:

    > Here are two things I find difficult in CSS.
    >
    > 1. The width of an object being width+margin+border+padding as opposed
    > to being just the width property! Suppose I want two columns one 25%
    > wide the other 75% wide.


    Just set width on the narrow column (25%). Leave width:auto; for the other
    one. It then should just take up the remaining width. Unless something
    else is wrong.

    > 2. I find that I just end up having to add divs to get the layout right
    > which means that my document now contains formatting instructions mixed
    > with its content - exactly what CSS was meant to avoid.


    That might be because you don't use what is there. The page has many
    elements, all off which you can style with CSS. But it is hard to know, if
    you don't show us a page on-line. URL please?

    --
    ______PretLetters:
    | weblog | http://www.pretletters.net/weblog/weblog.html |
    | webontwerp | http://www.pretletters.net/html/webontwerp.html |
    |zweefvliegen | http://www.pretletters.net/html/vliegen.html |
    Barbara de Zoete, Mar 3, 2006
    #2
    1. Advertising

  3. Tim Milstead

    Dylan Parry Guest

    Pondering the eternal question of "Hobnobs or Rich Tea?", Tim Milstead
    finally proclaimed:

    > 1. The width of an object being width+margin+border+padding as opposed
    > to being just the width property!


    That's the CSS Box Model. I personally think that it is badly
    implemented and, to me at least, the IE5 "broken" box model makes more
    sense! IIRC there is another CSS property that allows you to specify
    that the width should be interpreted in that way. Google might help you
    find what it is though as I forget.

    --
    Dylan Parry
    http://webpageworkshop.co.uk -- FREE Web tutorials and references
    Dylan Parry, Mar 3, 2006
    #3
  4. On Fri, 3 Mar 2006, Tim Milstead wrote:

    > I also have a guilty secret - I miss tables.


    Tables are fine for presenting information which is tabular by nature.

    What's wrong with (mis)using tables for layout is that tables persist
    in "working" no matter /how/ inappropriate they may be to the
    presentation situation.

    The great thing about CSS is that - used well - it can either assist
    (e.g by allowing stuff to float above or below when there's no room
    for it at the side), or indeed get calmly and quietly out of the way,
    when it's inappropriate to a particular display situation, while doing
    a beautiful job in the situations that the designer meant it for.

    > I know it's wrong but things were so much easier back then...


    And the results tended to be so much clumsier, when the browsing
    situation varied just a bit too far from what the designer thought was
    normal.

    On the other hand, CSS is potentially so much more powerful that, when
    used badly, it can produce a royal screw-up far worse that the worst
    abuses of tables - but that's not the fault of CSS itself, but of the
    way some folks attempt to apply it in the general WWW context. And
    then there are browser bugs, but (aside from the operating system
    component that thinks it knows better than to conform to mandatory
    requirements of the specifications) that is all so much better
    nowadays.
    Alan J. Flavell, Mar 3, 2006
    #4
  5. On Fri, 03 Mar 2006 12:04:32 +0100, Dylan Parry <>
    wrote:

    > Pondering the eternal question of "Hobnobs or Rich Tea?", Tim Milstead
    > finally proclaimed:
    >
    >> 1. The width of an object being width+margin+border+padding as opposed
    >> to being just the width property!

    >
    > That's the CSS Box Model.


    To me it represents common sense. What if you ship stuff across the
    Atlantic in your Ocean Steamer? What good will the deminsions of the items
    of your delicate cargo do, if not also the packing itself is taken into
    account or the distance the items in the cargo should remain between them
    (or both)?



    --
    ______PretLetters:
    | weblog | http://www.pretletters.net/weblog/weblog.html |
    | webontwerp | http://www.pretletters.net/html/webontwerp.html |
    |zweefvliegen | http://www.pretletters.net/html/vliegen.html |
    Barbara de Zoete, Mar 3, 2006
    #5
  6. Barbara de Zoete wrote:
    > > That's the CSS Box Model.

    > To me it represents common sense. What if you ship stuff across the
    > Atlantic in your Ocean Steamer?...


    Analogies are pretty stupid as you can make one up that supports any
    side to any argument. How about facts? Can you not support your
    argument using facts?
    Travis Newbury, Mar 3, 2006
    #6
  7. Tim Milstead

    dorayme Guest

    In article
    <>,
    "Travis Newbury" <> wrote:

    > Barbara de Zoete wrote:
    > > > That's the CSS Box Model.

    > > To me it represents common sense. What if you ship stuff across the
    > > Atlantic in your Ocean Steamer?...

    >
    > Analogies are pretty stupid as you can make one up that supports any
    > side to any argument. How about facts? Can you not support your
    > argument using facts?


    Well, hang on there Travis. You have just thrown out a valuable
    means of arguing things. BdeZ's analogy is not too bad to bring
    across a concept. Often, assembling facts is quite stupid, the
    other side can assemble the different facts or worse, the very
    same ones!

    You can see the point of an analogy in a way that you cannot see
    the point of a fact.

    --
    dorayme
    dorayme, Mar 3, 2006
    #7
  8. Tim Milstead

    dorayme Guest

    In article <op.s5t16ku6l8uz2z@zoete_b>,
    "Barbara de Zoete" <> wrote:

    > On Fri, 03 Mar 2006 11:04:39 +0100, Tim Milstead
    > <> wrote:
    >
    > > Here are two things I find difficult in CSS.
    > >
    > > 1. The width of an object being width+margin+border+padding as opposed
    > > to being just the width property! Suppose I want two columns one 25%
    > > wide the other 75% wide.

    >
    > Just set width on the narrow column (25%). Leave width:auto; for the other
    > one. It then should just take up the remaining width. Unless something
    > else is wrong.


    Yes, this seems sound advice.

    A further thing, perhaps someone can talk about the best and
    simplest technique they personally favour to get the two divs to
    line up height-wise, (align at top being easy of course).

    Personally I have given up bothering to design with such a
    requirement, it seeming to be rather bothersome. But it can come
    in handy when insistently asked to keep a tables layout effect
    for some established page - minus the tables! I would not boast
    any devices I use, but am all ears on good suggestions and
    perhaps others would like to know this too...

    --
    dorayme
    dorayme, Mar 3, 2006
    #8
  9. Tim Milstead

    Good Man Guest

    dorayme <> wrote in
    news::

    > A further thing, perhaps someone can talk about the best and
    > simplest technique they personally favour to get the two divs to
    > line up height-wise, (align at top being easy of course).


    this is ridiculously tricky and there is no 'easy' answer. which is
    outrageous considering CSS is all about layout!! the 'equal height'
    conundrum with two columns is indeed a huuuuge 'gotcha' when designing
    using CSS.

    even the CSS-guru site ALA has no CSS answer... they advise using a
    background image.

    http://www.alistapart.com/articles/fauxcolumns/


    otherwise, you can use a combo of js/css as mentioned here:
    http://www.paulbellows.com/getsmart/balance_columns/


    but, as you will see from hunting around, there is no quick answer....
    sucks.
    Good Man, Mar 3, 2006
    #9
  10. Tim Milstead

    dorayme Guest

    In article <Xns977BB44D18A8Asonicyouth@216.196.97.131>,
    Good Man <> wrote:

    > dorayme <> wrote in
    > news::
    >
    > > A further thing, perhaps someone can talk about the best and
    > > simplest technique they personally favour to get the two divs to
    > > line up height-wise, (align at top being easy of course).

    >
    > this is ridiculously tricky and there is no 'easy' answer. which is
    > outrageous considering CSS is all about layout!! the 'equal height'
    > conundrum with two columns is indeed a huuuuge 'gotcha' when designing
    > using CSS.
    >
    > even the CSS-guru site ALA has no CSS answer... they advise using a
    > background image.
    >
    > http://www.alistapart.com/articles/fauxcolumns/
    >


    Thank you for reminding me of this - good man!

    >
    > otherwise, you can use a combo of js/css as mentioned here:
    > http://www.paulbellows.com/getsmart/balance_columns/
    >
    >
    > but, as you will see from hunting around, there is no quick answer....
    > sucks.


    --
    dorayme
    dorayme, Mar 4, 2006
    #10
  11. dorayme wrote:
    > > > Atlantic in your Ocean Steamer?...

    > > Analogies are pretty stupid as you can make one up that supports any
    > > side to any argument. How about facts? Can you not support your
    > > argument using facts?

    > Well, hang on there Travis....
    > You can see the point of an analogy in a way that you cannot see
    > the point of a fact.


    Sorry dorayme, I disagee. If both you and I can take the same fact,
    and use a different analogy to help someone see a fact the way we want
    them to see it, then how does that help?

    A fact is a fact. One does not need to explain it using something
    completely unrelated.
    Travis Newbury, Mar 6, 2006
    #11
  12. Tim Milstead

    Els Guest

    Travis Newbury wrote:
    > dorayme wrote:
    >>> > Atlantic in your Ocean Steamer?...
    >>> Analogies are pretty stupid as you can make one up that supports any
    >>> side to any argument. How about facts? Can you not support your
    >>> argument using facts?

    >> Well, hang on there Travis....
    >> You can see the point of an analogy in a way that you cannot see
    >> the point of a fact.

    >
    > Sorry dorayme, I disagee. If both you and I can take the same fact,
    > and use a different analogy to help someone see a fact the way we want
    > them to see it, then how does that help?
    >
    > A fact is a fact. One does not need to explain it using something
    > completely unrelated.


    You mean, you've never tried to explain a fact to anyone?
    You never said "it's like...." and then had a reply like "Ah! Now I
    see what you mean!" ?

    --
    Els http://locusmeus.com/
    Els, Mar 6, 2006
    #12
  13. Els wrote:
    > > Sorry dorayme, I disagee. If both you and I can take the same fact,
    > > and use a different analogy to help someone see a fact the way we want
    > > them to see it, then how does that help?
    > > A fact is a fact. One does not need to explain it using something
    > > completely unrelated.

    > You mean, you've never tried to explain a fact to anyone?
    > You never said "it's like...." and then had a reply like "Ah! Now I
    > see what you mean!" ?


    No, I am saying that someone's "understanding" of a fact can be swayed
    via an analogy. which is why they don't allow them in court.
    Travis Newbury, Mar 6, 2006
    #13
  14. Tim Milstead

    Els Guest

    Travis Newbury wrote:

    > Els wrote:
    >>> Sorry dorayme, I disagee. If both you and I can take the same fact,
    >>> and use a different analogy to help someone see a fact the way we want
    >>> them to see it, then how does that help?
    >>> A fact is a fact. One does not need to explain it using something
    >>> completely unrelated.

    >> You mean, you've never tried to explain a fact to anyone?
    >> You never said "it's like...." and then had a reply like "Ah! Now I
    >> see what you mean!" ?

    >
    > No, I am saying that someone's "understanding" of a fact can be swayed
    > via an analogy. which is why they don't allow them in court.


    Sorry, missed the 'allowed in court' bit in the above discussion.
    I thought Barbara just used a valuable analogy to explain her opinion
    on the logic of the box model.
    (and I don't think there's anything wrong or stupid about swaying
    someone's understanding of the box model in the direction of logic ;-)
    )

    --
    Els http://locusmeus.com/
    Els, Mar 6, 2006
    #14
  15. Tim Milstead

    Dylan Parry Guest

    Pondering the eternal question of "Hobnobs or Rich Tea?", Els finally
    proclaimed:

    > Sorry, missed the 'allowed in court' bit in the above discussion.
    > I thought Barbara just used a valuable analogy to explain her opinion
    > on the logic of the box model.


    Yes, but in that analogy the logic of the box model was explained as
    knowing the width of the item and then being told that padding is in
    addition, so that the shipping company would know how much space to
    allocate.

    In the IE5 "broken" model, as in shipping, the dimensions of the "cargo"
    are specified including the packaging. The shipping company isn't
    expected to be told that they have an item measuring 1x1x1 feet with six
    inches of padding around it. The expect to be told that the box is
    2x2x2. The logic is flawed, or at least it is if you give an irrelevant
    analogy that can be used to sway someone to both sides of the argument
    ;)

    --
    Dylan Parry
    http://webpageworkshop.co.uk -- FREE Web tutorials and references
    Dylan Parry, Mar 6, 2006
    #15
  16. Tim Milstead

    Els Guest

    Dylan Parry wrote:

    > Pondering the eternal question of "Hobnobs or Rich Tea?", Els finally
    > proclaimed:
    >
    >> Sorry, missed the 'allowed in court' bit in the above discussion.
    >> I thought Barbara just used a valuable analogy to explain her opinion
    >> on the logic of the box model.

    >
    > Yes, but in that analogy the logic of the box model was explained as
    > knowing the width of the item and then being told that padding is in
    > addition, so that the shipping company would know how much space to
    > allocate.
    >
    > In the IE5 "broken" model, as in shipping, the dimensions of the "cargo"
    > are specified including the packaging.


    Actually, I was thinking that when I first read the analogy :)

    > The shipping company isn't
    > expected to be told that they have an item measuring 1x1x1 feet with six
    > inches of padding around it. The expect to be told that the box is
    > 2x2x2. The logic is flawed, or at least it is if you give an irrelevant
    > analogy that can be used to sway someone to both sides of the argument
    > ;)


    So, it's not really a bad analogy, just applied to a bad fact (broken
    box model) :)

    I can see Barbara's reasoning though, as in width is of the object
    inside the packaging (which really only is 1 x 1 x 1 foot), and
    padding and packaging are added to know how much room it needs on a
    cargo ship. Maybe the analogy should contain the order you place at
    the packaging company: "1 x packaging for item of 1 x 1 x 1 feet to go
    on cargo ship, preferably with room for 6 inches of padding" ;-)

    --
    Els http://locusmeus.com/
    http://locusoptimus.com/
    Els, Mar 6, 2006
    #16
  17. Tim Milstead

    kchayka Guest

    Els wrote:
    >
    > Maybe the analogy should contain the order you place at
    > the packaging company: "1 x packaging for item of 1 x 1 x 1 feet to go
    > on cargo ship, preferably with room for 6 inches of padding" ;-)


    And don't forget to allow for the thickness of the container itself.
    That would be your box border. ;)

    --
    Reply email address is a bottomless spam bucket.
    Please reply to the group so everyone can share.
    kchayka, Mar 6, 2006
    #17
  18. Tim Milstead

    Els Guest

    kchayka wrote:

    > Els wrote:
    >>
    >> Maybe the analogy should contain the order you place at
    >> the packaging company: "1 x packaging for item of 1 x 1 x 1 feet to go
    >> on cargo ship, preferably with room for 6 inches of padding" ;-)

    >
    > And don't forget to allow for the thickness of the container itself.
    > That would be your box border. ;)


    Yup - the total size to go on the ship will be larger than the earlier
    calculated 2 x 2 x 2 feet :)

    --
    Els http://locusmeus.com/
    Els, Mar 6, 2006
    #18
  19. Tim Milstead

    dorayme Guest

    In article
    <>,
    "Travis Newbury" <> wrote:

    > dorayme wrote:
    > > > > Atlantic in your Ocean Steamer?...
    > > > Analogies are pretty stupid as you can make one up that supports any
    > > > side to any argument. How about facts? Can you not support your
    > > > argument using facts?

    > > Well, hang on there Travis....
    > > You can see the point of an analogy in a way that you cannot see
    > > the point of a fact.

    >
    > Sorry dorayme, I disagee. If both you and I can take the same fact,
    > and use a different analogy to help someone see a fact the way we want
    > them to see it, then how does that help?
    >
    > A fact is a fact. One does not need to explain it using something
    > completely unrelated.


    This is quite a misunderstanding. I thought BdeZ's analogy not
    too bad. But others have pointed out it could be better. Fine!
    But your point is about analogies in general.

    Of course a fact is a fact! Is it less noteworthy that an analogy
    is an analogy?

    About explanation, (if I can add to Els' point on this): It is
    impossible completely and utterly to explain some things by
    reference to facts. These hard gritty little stones just do not
    do the trick. In trying to understand most of biological or
    computer or mechanical processes, one needs to think in terms of
    them having purposes. As a matter of fact they do not have
    purposes (let's not argue this for now). But try to explain even
    how any control system in any plant (man-made factory or natural)
    works to someone without making like it does this _so_ that it
    can do that. Analogy with human purpose is built in writ large to
    almost every explanation of so much. And we cannot easily or
    practically do without it. Try to understand a computer program
    in the factest of facts: assembly language! Almost no one can.

    And - btw - who sez you can't use analogies in court? Want me to
    ferret out transcripts of counsel speeches? Want to leave an
    escrow bet on this?

    --
    dorayme
    dorayme, Mar 6, 2006
    #19
  20. Tim Milstead

    dorayme Guest

    In article
    <>,
    "Travis Newbury" <> wrote:

    > dorayme wrote:
    > > > > Atlantic in your Ocean Steamer?...
    > > > Analogies are pretty stupid as you can make one up that supports any
    > > > side to any argument. How about facts? Can you not support your
    > > > argument using facts?

    > > Well, hang on there Travis....
    > > You can see the point of an analogy in a way that you cannot see
    > > the point of a fact.

    >
    > Sorry dorayme, I disagee. If both you and I can take the same fact,
    > and use a different analogy to help someone see a fact the way we want
    > them to see it, then how does that help?
    >
    > A fact is a fact. One does not need to explain it using something
    > completely unrelated.


    .... oh and I forgot to add that it is exquisite that a former
    Bush voter should so love facts, not because Bush gets his right,
    but rather because it shows a propensity of The Right.

    (I can't explain this further here because I cannot risk Steve
    Pugh asking me what I am on again... see what he said to me 18
    years ago!)

    You remind me of Dr. Johnson in your liking facts:

    http://www.samueljohnson.com/refutati.html

    :)

    --
    dorayme
    dorayme, Mar 6, 2006
    #20
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    0
    Views:
    527
  2. Tony
    Replies:
    3
    Views:
    179
    Josh Twist
    Feb 12, 2006
  3. Frank Millman
    Replies:
    0
    Views:
    86
    Frank Millman
    Mar 18, 2013
  4. Chris Angelico
    Replies:
    1
    Views:
    107
    Steven D'Aprano
    Mar 18, 2013
  5. Frank Millman
    Replies:
    0
    Views:
    86
    Frank Millman
    Mar 18, 2013
Loading...

Share This Page