How do I cut down a DIV's width?

Discussion in 'HTML' started by delerious@no.spam.com, Dec 3, 2003.

  1. Guest

    I'm trying to change my code to not use tables at all. Please take a look at
    this page:
    http://home.comcast.net/~delerious1/index.html

    The top set of links does not use tables, whereas the bottom set of links does
    use a table. I would like the top set of links to look like the bottom set.
    How do I get the DIV to be as wide as the longest text (actually 0.4 em wider
    than the longest text), instead of going across the whole screen?
     
    , Dec 3, 2003
    #1
    1. Advertising

  2. rf Guest

    <> wrote in message
    news:...
    > I'm trying to change my code to not use tables at all. Please take a look

    at
    > this page:
    > http://home.comcast.net/~delerious1/index.html
    >
    > The top set of links does not use tables, whereas the bottom set of links

    does
    > use a table. I would like the top set of links to look like the bottom

    set.
    > How do I get the DIV to be as wide as the longest text (actually 0.4 em

    wider
    > than the longest text), instead of going across the whole screen?


    float: left;

    Cheers
    Richard.
     
    rf, Dec 3, 2003
    #2
    1. Advertising

  3. brucie Guest

    in post <news:>
    said:

    > I'm trying to change my code to not use tables at all. Please take a look at
    > this page:
    > http://home.comcast.net/~delerious1/index.html
    >
    > The top set of links does not use tables, whereas the bottom set of links does
    > use a table. I would like the top set of links to look like the bottom set.
    > How do I get the DIV to be as wide as the longest text (actually 0.4 em wider
    > than the longest text), instead of going across the whole screen?


    basic setup:
    http://stuff.bruciesusenetshit.info/menu-thingy.html

    more advanced:
    http://stuff.bruciesusenetshit.info/menu/page1.html

    --
    brucie
    03/December/2003 08:41:22 pm kilo
     
    brucie, Dec 3, 2003
    #3
  4. brucie Guest

    in post <news:>
    said:

    > http://home.comcast.net/~delerious1/index.html


    just for future reference:

    <td>
    this is yucky and causes problems with rendering
    </td>

    <td>this doesn't</td>

    this is also yucky
    <td><img ...> </td>

    this is yummy
    <td><img ...></td>


    --
    brucie
    03/December/2003 10:00:28 pm kilo
     
    brucie, Dec 3, 2003
    #4
  5. rf wrote:

    >> The top set of links does not use tables, whereas the bottom set of links
    >> does use a table. I would like the top set of links to look like the
    >> bottom set. How do I get the DIV to be as wide as the longest text
    >> (actually 0.4 em wider than the longest text), instead of going across
    >> the whole screen?


    > float: left;


    Actually, no - since the CSS spec requires that you set an explicit width
    when you make content float.

    The correct way to achieve this type of rendering would be to muck about
    with the display property in ways which won't work in Microsoft's file
    manager.

    --
    David Dorward <http://dorward.me.uk/>
     
    David Dorward, Dec 3, 2003
    #5
  6. Guest

    On Wed, 3 Dec 2003 22:05:28 +1000, brucie <>
    wrote:
    >just for future reference:
    >
    ><td>
    >this is yucky and causes problems with rendering
    ></td>
    >
    ><td>this doesn't</td>
    >
    >this is also yucky
    ><td><img ...> </td>
    >
    >this is yummy
    ><td><img ...></td>


    So the rule is that anything that only has inline elements inside it shouldn't
    have superfluous whitespace?
     
    , Dec 4, 2003
    #6
  7. brucie Guest

    in post <news:>
    said:


    >><td>
    >>this is yucky and causes problems with rendering
    >></td>
    >>
    >><td>this doesn't</td>
    >>
    >>this is also yucky
    >><td><img ...> </td>
    >>
    >>this is yummy
    >><td><img ...></td>


    > So the rule is that anything that only has inline elements inside it shouldn't
    > have superfluous whitespace?


    no. it doesn't matter what the element contains. in the first example
    the line break after <td> and the one before </td> is supposed to be
    ignored but browsers don't so you may end up with extra space you don't
    want.

    in the second example the cell not only contains the image but also a
    single space which you probably don't want. e.g if you're trying to
    align images in adjacent cells that space will prevent it.


    --
    brucie
    04/December/2003 11:02:43 am kilo
     
    brucie, Dec 4, 2003
    #7
  8. Guest

    On Wed, 3 Dec 2003 20:43:42 +1000, brucie <>
    wrote:
    >basic setup:
    >http://stuff.bruciesusenetshit.info/menu-thingy.html


    Hey I just noticed an IE (5.5) bug. Try this with the above menu:

    - Move the mouse over 'menu 7'
    - Click on 'menu 7', and while keeping the mouse button depressed, move the
    mouse away from 'menu 7'
    - Release the mouse button.

    I've tried this several times, and many times (not all of the time), 'menu 7'
    will remain black instead of going back to the yellowish color.
     
    , Dec 4, 2003
    #8
  9. brucie Guest

    in post <news:>
    said:

    >>http://stuff.bruciesusenetshit.info/menu-thingy.html


    > Hey I just noticed an IE (5.5) bug.


    upgrade or put up with it.

    > Try this with the above menu:


    i cant, i upgraded to IE6 over 2 years go

    --
    brucie
    04/December/2003 03:44:46 pm kilo
     
    brucie, Dec 4, 2003
    #9
  10. Guest

    On Thu, 4 Dec 2003 15:47:33 +1000, brucie <>
    wrote:
    >> Hey I just noticed an IE (5.5) bug.

    >
    >upgrade or put up with it.
    >
    >> Try this with the above menu:

    >
    >i cant, i upgraded to IE6 over 2 years go


    So you can't reproduce it in IE6, or you didn't try? If you can't reproduce
    it, then that's good to know it's been fixed.
     
    , Dec 4, 2003
    #10
  11. brucie Guest

    in post <news:>
    said:

    >>> Try this with the above menu:


    >>i cant, i upgraded to IE6 over 2 years go


    > So you can't reproduce it in IE6, or you didn't try?


    cant reproduce

    > If you can't reproduce it, then that's good to know it's been fixed.


    it may not be a bug, it could just be IE5.5s way of indicating that that
    link still has focus. what happens when you drag the link off the page
    to another location? does it remain black after the link has been
    written to the new location?

    --
    brucie
    04/December/2003 04:11:25 pm kilo
     
    brucie, Dec 4, 2003
    #11
    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. AndrewF
    Replies:
    1
    Views:
    786
    Bruce Barker
    Oct 10, 2005
  2. Coder
    Replies:
    1
    Views:
    703
    Cowboy \(Gregory A. Beamer\)
    Jun 24, 2006
  3. =?Utf-8?B?cm9kY2hhcg==?=

    how to: div width = browser.width?

    =?Utf-8?B?cm9kY2hhcg==?=, Oct 27, 2006, in forum: ASP .Net
    Replies:
    3
    Views:
    531
    =?Utf-8?B?cm9kY2hhcg==?=
    Oct 30, 2006
  4. Steve Richter
    Replies:
    2
    Views:
    7,927
    Steve Richter
    Jun 15, 2007
  5. SamuelXiao
    Replies:
    5
    Views:
    280
    Thomas 'PointedEars' Lahn
    Jan 6, 2010
Loading...

Share This Page