[WSG] Max-width issues

2006-10-03 Thread John 'Max' Maxwell

Good Morning All,

I am having a bit of a problem with the old 'max-width' issue in IE and 
would like to know your thoughts on the subject.


If I add this to my style sheet:

#outer_wrapper {
   max-width: 800px; }

Then I am fine in FF but not in IE - in IE the outer container just 
keeps stretching with the browser window. So if I add the following, 
then all is well in all browsers BUT the code is no longer valid:


* html div#outer_wrapper {width: 800px /* fallback value */;
width:expression(((document.compatMode 
document.compatMode=='CSS1Compat') ?
document.documentElement.clientWidth :
document.body.clientWidth)
 1000 ? 800px : (((document.compatMode 
document.compatMode=='CSS1Compat') ?
document.documentElement.clientWidth :
document.body.clientWidth)  570 ? 552px : 99.7%));
}

Is my syntax or something incorrect or is there just no way of adding 
this fix without going 'invalid'?? Does the above code even belong in a 
style sheet as it doesn't look like standard CSS to me. So you know, I 
am a designer who is wholly self taught in XHTML/CSS/PHP so there are 
huge gaps in my 'education' - I would therefore appreciate careful 
handling. Having said that, the 10 years I spent in the military when I 
should have been at Art School does mean I am capable of taking it 
'straight' - I would just appreciate it if any derisory comments about 
my code were followed by a helpful tip of how to put it right ;-)


Many thanks.

Kind regards,

Max.



***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***



Re: [WSG] Max-width issues

2006-10-03 Thread Tim B

Hi John

John 'Max' Maxwell wrote:
 #outer_wrapper {
max-width: 800px; }

 Then I am fine in FF but not in IE

The max-width property unfortunately isn't supported by IE6 
and below, which is where I assume the problem is.


I guess (and this is a guess) that max-width is actually fixed 
in IE7 as long as you use a strict doctype.


How that helps.
Tim


***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***



Re: [WSG] Max-width issues

2006-10-03 Thread John Faulds
Put the max-width expression in an IE-only stylesheet served up with  
conditional comments. That way there's no need for the Holly Hack (in  
fact, it's best to put anything that requires the Holly Hack in an IE-only  
stylesheet) and your CSS will validate OK too.


On Tue, 03 Oct 2006 18:29:08 +1000, John 'Max' Maxwell  
[EMAIL PROTECTED] wrote:



Good Morning All,

I am having a bit of a problem with the old 'max-width' issue in IE and  
would like to know your thoughts on the subject.


If I add this to my style sheet:

#outer_wrapper {
max-width: 800px; }

Then I am fine in FF but not in IE - in IE the outer container just  
keeps stretching with the browser window. So if I add the following,  
then all is well in all browsers BUT the code is no longer valid:


* html div#outer_wrapper {width: 800px /* fallback value */;
width:expression(((document.compatMode 
document.compatMode=='CSS1Compat') ?
document.documentElement.clientWidth :
document.body.clientWidth)
  1000 ? 800px : (((document.compatMode 
document.compatMode=='CSS1Compat') ?
document.documentElement.clientWidth :
document.body.clientWidth)  570 ? 552px : 99.7%));
}

Is my syntax or something incorrect or is there just no way of adding  
this fix without going 'invalid'?? Does the above code even belong in a  
style sheet as it doesn't look like standard CSS to me. So you know, I  
am a designer who is wholly self taught in XHTML/CSS/PHP so there are  
huge gaps in my 'education' - I would therefore appreciate careful  
handling. Having said that, the 10 years I spent in the military when I  
should have been at Art School does mean I am capable of taking it  
'straight' - I would just appreciate it if any derisory comments about  
my code were followed by a helpful tip of how to put it right ;-)


Many thanks.

Kind regards,

Max.



***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***





--
Tyssen Design
www.tyssendesign.com.au
Ph: (07) 3300 3303
Mb: 0405 678 590


***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***



Re: [WSG] Max-width issues

2006-10-03 Thread Gunlaug Sørtun

John 'Max' Maxwell wrote:

Is my syntax or something incorrect or is there just no way of adding
 this fix without going 'invalid'?? Does the above code even belong 
in a style sheet as it doesn't look like standard CSS to me.


Your syntax is correct, and if you've got the values right it'll work
fine in IE6 (and IE5+ win).
Ref: http://www.gunlaug.no/contents/wd_additions_14.html

An IE-expression is by definition: proprietary, non-valid, CSS - you
can't make it valid. Nevertheless; IE-expressions belong in CSS, and
nowhere else.

You can hide it - and other non-valid workarounds for old IE-win - from
the validator by putting them in a separate stylesheet, linked to from
inside a 'conditional comment'.
Ref: http://www.gunlaug.no/contents/wd_1_02_01.html#item2

regards
Georg
--
http://www.gunlaug.no


***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***



Re: [WSG] Max-width issues

2006-10-03 Thread John 'Max' Maxwell




Hi Germ,

i must have the syntax wrong - just tried that and it stopped IE
working in addition to still being invalid CSS.

Was your whole CSS like this:


#outer_wrapper {
 max-width: 800px;
}
* html div#outer_wrapper {width: 800px /* fallback value */;
width:_expression_((document.documentElement.offsetWidth
 820)? "800px": "auto" ); 
}

I just tried this in my style sheet to no avail.

Cheers,

Max.



Germ wrote:
I
asked this question (or similar) just recently and so if you go through
the back issues, you will find some discussion about it and hears the
code that I used and it all works fine for me
  
  width:_expression_((document.documentElement.offsetWidth
 820)? "800px": "auto" );
  





***List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfmUnsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfmHelp: [EMAIL PROTECTED]***

Re: [WSG] Max-width issues

2006-10-03 Thread John 'Max' Maxwell

Your syntax is correct, and if you've got the values right it'll work

fine in IE6 (and IE5+ win).
Ref: http://www.gunlaug.no/contents/wd_additions_14.html

An IE-expression is by definition: proprietary, non-valid, CSS - you
can't make it valid. Nevertheless; IE-expressions belong in CSS, and
nowhere else.

You can hide it - and other non-valid workarounds for old IE-win - from
the validator by putting them in a separate stylesheet, linked to from
inside a 'conditional comment'.
Ref: http://www.gunlaug.no/contents/wd_1_02_01.html#item2

regards
Georg

Many thanks Georg - I've sorted it - great news!!


***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***