Why doesn´t width and max-width work?

Discussion in 'HTML' started by palun, Jan 11, 2008.

  1. palun

    palun Guest

    Ok, here´s a really elementary question:

    -- Why doesn't "width" and/or "max-width" in CSS have any effect on, for
    instance <div> or <td>? (I'm using Firefox.)

    /u
     
    palun, Jan 11, 2008
    #1
    1. Advertising

  2. palun

    rf Guest

    "palun" <> wrote in message
    news:64Ghj.2626$...
    > Ok, here´s a really elementary question:
    >
    > -- Why doesn't "width" and/or "max-width" in CSS have any effect on, for
    > instance <div> or <td>? (I'm using Firefox.)


    They do. URL to what you have tried?

    --
    Richard.
     
    rf, Jan 11, 2008
    #2
    1. Advertising

  3. palun

    palun Guest

    Sorry, it's not deployed. But the code is really simple:

    In html:

    <div id="anId">
    Some stuff...
    </div>

    and in css:

    #anId {
    width=400px;
    }

    But the content ("Some stuff") still gets spread out over the whole page...


    I just realized: Could any of the stuff inside the div affect its width?
    I.e. can the content affect the width of the of container? (Not very
    logical...)

    /ulf

    rf skrev:
    > "palun" <> wrote in message
    > news:64Ghj.2626$...
    >> Ok, here´s a really elementary question:
    >>
    >> -- Why doesn't "width" and/or "max-width" in CSS have any effect on, for
    >> instance <div> or <td>? (I'm using Firefox.)

    >
    > They do. URL to what you have tried?
    >
     
    palun, Jan 11, 2008
    #3
  4. ..oO(palun)

    >Sorry, it's not deployed. But the code is really simple:
    >
    >In html:
    >
    ><div id="anId">
    >Some stuff...
    ></div>
    >
    >and in css:
    >
    >#anId {
    > width=400px;

    ^
    >}
    >
    >But the content ("Some stuff") still gets spread out over the whole page...


    It's always a good idea to validate the HTML and CSS before asking for
    help:

    #anId {
    width: 400px;
    }

    Micha
     
    Michael Fesser, Jan 11, 2008
    #4
  5. palun

    palun Guest

    Terribly sorry. My mistake. (I wrote the code in the message. Should
    have copied.)

    Anyway, the code is correct in the CSS-file (and it still doesn't work).

    /ulf

    Michael Fesser skrev:
    > .oO(palun)
    >
    >> Sorry, it's not deployed. But the code is really simple:
    >>
    >> In html:
    >>
    >> <div id="anId">
    >> Some stuff...
    >> </div>
    >>
    >> and in css:
    >>
    >> #anId {
    >> width=400px;

    > ^
    >> }
    >>
    >> But the content ("Some stuff") still gets spread out over the whole page...

    >
    > It's always a good idea to validate the HTML and CSS before asking for
    > help:
    >
    > #anId {
    > width: 400px;
    > }
    >
    > Micha
     
    palun, Jan 11, 2008
    #5
  6. palun

    Neredbojias Guest

    Re: Why doesn´t width and max-width wor k?

    Well bust mah britches and call me cheeky, on Fri, 11 Jan 2008 10:22:23
    GMT palun scribed:

    > Terribly sorry. My mistake. (I wrote the code in the message. Should
    > have copied.)
    >
    > Anyway, the code is correct in the CSS-file (and it still doesn't
    > work).


    No, it isn't correct or it would work. Trust me.

    --
    Neredbojias
    Riches are their own reward.
     
    Neredbojias, Jan 11, 2008
    #6
  7. palun

    Ben C Guest

    On 2008-01-11, palun <> wrote:
    > Terribly sorry. My mistake. (I wrote the code in the message. Should
    > have copied.)
    >
    > Anyway, the code is correct in the CSS-file (and it still doesn't work).

    [...]
    >>> But the content ("Some stuff") still gets spread out over the whole page...

    >>
    >> It's always a good idea to validate the HTML and CSS before asking for
    >> help:
    >>
    >> #anId {
    >> width: 400px;
    >> }


    I assure you width does work. There must be something else going on:
    perhaps another more specific style sets width back to auto, perhaps you
    mis-typed the selector, perhaps the contents overflow.

    This is why you have to post a url.
     
    Ben C, Jan 11, 2008
    #7
  8. palun

    palun Guest

    Re: Why doesn´t width and max-width wor k?

    Thanks for your help.
    Much appreciated.
    /u

    Neredbojias skrev:
    > Well bust mah britches and call me cheeky, on Fri, 11 Jan 2008 10:22:23
    > GMT palun scribed:
    >
    >> Terribly sorry. My mistake. (I wrote the code in the message. Should
    >> have copied.)
    >>
    >> Anyway, the code is correct in the CSS-file (and it still doesn't
    >> work).

    >
    > No, it isn't correct or it would work. Trust me.
    >
     
    palun, Jan 11, 2008
    #8
  9. palun

    palun Guest

    You are right. I should deploy it (though it looks terrible right now).
    BTW: I did validate it and that seems ok apart from the
    "wicket:id"-attributes on some of the tags (required by the wicket
    framework -- great stuff if you know some java)
    /u

    Ben C skrev:
    > On 2008-01-11, palun <> wrote:
    >> Terribly sorry. My mistake. (I wrote the code in the message. Should
    >> have copied.)
    >>
    >> Anyway, the code is correct in the CSS-file (and it still doesn't work).

    > [...]
    >>>> But the content ("Some stuff") still gets spread out over the whole page...
    >>> It's always a good idea to validate the HTML and CSS before asking for
    >>> help:
    >>>
    >>> #anId {
    >>> width: 400px;
    >>> }

    >
    > I assure you width does work. There must be something else going on:
    > perhaps another more specific style sets width back to auto, perhaps you
    > mis-typed the selector, perhaps the contents overflow.
    >
    > This is why you have to post a url.
     
    palun, Jan 11, 2008
    #9
  10. palun

    JJ Guest

    palun wrote:
    > You are right.


    It's a shame you got any responses at all. You are inconsiderate. You
    couldn't be bothered to create an online example of the problem, you
    couldn't be bothered to post accurate code, and you couldn't be bothered
    to be consistent with everybody else in the group and type your response
    below the text you were referring to.
     
    JJ, Jan 11, 2008
    #10
  11. palun

    rf Guest

    "palun" <> wrote in message
    news:zrHhj.2632$...
    > Terribly sorry. My mistake. (I wrote the code in the message. Should have
    > copied.)
    >
    > Anyway, the code is correct in the CSS-file (and it still doesn't work).


    I am here to tell you that it works for untold millions of other pages out
    there. Why is yours different? I don't bloody know, you won't show it to me!

    Again: URL? If you don't supply one then nobody here has a snowflakes chance
    in hell of helping you.
    --
    Richard.
     
    rf, Jan 11, 2008
    #11
  12. palun

    Chaddy2222 Guest

    On Jan 11, 10:44 pm, "rf" <> wrote:
    > "palun" <> wrote in message
    >
    > news:zrHhj.2632$...
    >
    > > Terribly sorry. My mistake. (I wrote the code in the message. Should have
    > > copied.)

    >
    > > Anyway, the code is correct in the CSS-file (and it still doesn't work).

    >
    > I am here to tell you that it works for untold millions of other pages out
    > there. Why is yours different? I don't bloody know, you won't show it to me!
    >
    > Again: URL? If you don't supply one then nobody here has a snowflakes chance
    > in hell of helping you.

    Well it depends on what browser the Op is useing, IE6 does not support
    min and max width. IE7 does though.
    --
    Regards Chad. http://freewebdesignonline.org
     
    Chaddy2222, Jan 11, 2008
    #12
  13. ..oO(Chaddy2222)

    >On Jan 11, 10:44 pm, "rf" <> wrote:
    >>
    >> Again: URL? If you don't supply one then nobody here has a snowflakes chance
    >> in hell of helping you.

    >
    >Well it depends on what browser the Op is useing, IE6 does not support
    >min and max width. IE7 does though.


    He's on Firefox.

    Micha
     
    Michael Fesser, Jan 11, 2008
    #13
  14. palun

    Chaddy2222 Guest

    On Jan 12, 12:53 am, Michael Fesser <> wrote:
    > .oO(Chaddy2222)
    >
    > >On Jan 11, 10:44 pm, "rf" <> wrote:

    >
    > >> Again: URL? If you don't supply one then nobody here has a snowflakes chance
    > >> in hell of helping you.

    >
    > >Well it depends on what browser the Op is useing, IE6 does not support
    > >min and max width. IE7 does though.

    >
    > He's on Firefox.
    >
    > Micha

    Well good for him then.
    It's probably just a mark-up error but who knows the OP did not give
    us an URL, how many timse do we need to say / write such advice before
    people start actually makeing life easier for all of us by giving us a
    URL to a problem.
    That was a long rant from me.
    --
    Regards Chad. http://freewebdesignonline.org
     
    Chaddy2222, Jan 11, 2008
    #14
  15. palun

    dorayme Guest

    In article <PEIhj.1969$>,
    "rf" <> wrote:

    > "palun" <> wrote in message
    > news:zrHhj.2632$...
    > > Terribly sorry. My mistake. (I wrote the code in the message. Should have
    > > copied.)
    > >
    > > Anyway, the code is correct in the CSS-file (and it still doesn't work).

    >
    > I am here to tell you that it works for untold millions of other pages out
    > there. Why is yours different? I don't bloody know, you won't show it to me!
    >
    > Again: URL? If you don't supply one then nobody here has a snowflakes chance
    > in hell of helping you.


    O I dunno? Did you see how Boji said trust him and the OP just
    fell over in gratitude like it was the biggest revelation since
    sliced white bread was announced to the general public?

    --
    dorayme
     
    dorayme, Jan 11, 2008
    #15
  16. palun

    Neredbojias Guest

    Well bust mah britches and call me cheeky, on Fri, 11 Jan 2008 20:19:52
    GMT dorayme scribed:

    > In article <PEIhj.1969$>,
    > "rf" <> wrote:


    >> Again: URL? If you don't supply one then nobody here has a snowflakes
    >> chance in hell of helping you.

    >
    > O I dunno? Did you see how Boji said trust him and the OP just
    > fell over in gratitude like it was the biggest revelation since
    > sliced white bread was announced to the general public?


    You may enjoy the music vid at

    http://www.neredbojias.com/

    The broad reminds me of you. (PS: It's Flash and seems to be a bit sticky
    at peak times and you may need hi-speed.)

    --
    Neredbojias
    Riches are their own reward.
     
    Neredbojias, Jan 11, 2008
    #16
    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. Paul Furman

    min-width max-width again

    Paul Furman, Feb 9, 2004, in forum: HTML
    Replies:
    10
    Views:
    717
    Beauregard T. Shagnasty
    Feb 9, 2004
  2. Lois
    Replies:
    1
    Views:
    3,313
    Ryan Stewart
    Dec 27, 2004
  3. Mr. SweatyFinger
    Replies:
    2
    Views:
    2,078
    Smokey Grindel
    Dec 2, 2006
  4. Summercool
    Replies:
    9
    Views:
    902
    dorayme
    Oct 23, 2007
  5. kriton
    Replies:
    0
    Views:
    348
    kriton
    Apr 22, 2005
Loading...

Share This Page