HighDots Forums  

Why doesn´t width and max-width work?

alt.html alt.html


Discuss Why doesn´t width and max-width work? in the alt.html forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
palun
 
Posts: n/a

Default Why doesn´t width and max-width work? - 01-11-2008 , 02:49 AM






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


Reply With Quote
  #2  
Old   
rf
 
Posts: n/a

Default Re: Why doesn´t width and max-width work? - 01-11-2008 , 02:57 AM







"palun" <flume2001 (AT) gmail (DOT) com> wrote

Quote:
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.




Reply With Quote
  #3  
Old   
palun
 
Posts: n/a

Default Re: Why doesn´t width and max-width work? - 01-11-2008 , 03:11 AM



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:
Quote:
"palun" <flume2001 (AT) gmail (DOT) com> wrote in message
news:64Ghj.2626$R_4.2127 (AT) newsb (DOT) telia.net...
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?


Reply With Quote
  #4  
Old   
Michael Fesser
 
Posts: n/a

Default Re: Why doesn´t width and max-width work? - 01-11-2008 , 03:20 AM



..oO(palun)

Quote:
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


Reply With Quote
  #5  
Old   
palun
 
Posts: n/a

Default Re: Why doesn´t width and max-width work? - 01-11-2008 , 04:22 AM



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:
Quote:
.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

Reply With Quote
  #6  
Old   
Neredbojias
 
Posts: n/a

Default Re: Why doesn´t width and max-width wor k? - 01-11-2008 , 04:30 AM



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

Quote:
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.


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

Default Re: Why doesn´t width and max-width work? - 01-11-2008 , 04:32 AM



On 2008-01-11, palun <flume2001 (AT) gmail (DOT) com> wrote:
Quote:
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.


Reply With Quote
  #8  
Old   
palun
 
Posts: n/a

Default Re: Why doesn´t width and max-width wor k? - 01-11-2008 , 04:39 AM



Thanks for your help.
Much appreciated.
/u

Neredbojias skrev:
Quote:
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.


Reply With Quote
  #9  
Old   
palun
 
Posts: n/a

Default Re: Why doesn´t width and max-width work? - 01-11-2008 , 04:44 AM



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:
Quote:
On 2008-01-11, palun <flume2001 (AT) gmail (DOT) com> 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.

Reply With Quote
  #10  
Old   
JJ
 
Posts: n/a

Default Re: Why doesn´t width and max-width work? - 01-11-2008 , 05:28 AM



palun wrote:
Quote:
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.


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.