473,413 Members | 1,700 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,413 software developers and data experts.

New CSS rule craches IE !!

Today I added this rule to my web site:

#container {
min-width: 950px;
width:expression(document.body.clientWidth < 950? "950px": "auto" );
}

And it crashes IE when the width of the window is less than 950px :(
How would you correct it?

--
Boost the visibility of your web site in Google!
http://www.digitalpoint.com/tools/ad-network/?s=5203

Using Opera's revolutionary e-mail client: http://www.opera.com/mail/

http://www.auriance.com - http://www.auriance.net
Jul 21 '05 #1
7 4920
On Fri, 04 Mar 2005 14:03:46 -0300 Unknown User wrote:
Today I added this rule to my web site:

#container {
min-width: 950px;
width:expression(document.body.clientWidth < 950? "950px": "auto" );
}

And it crashes IE when the width of the window is less than 950px :(
How would you correct it?


You fix the problem by using a browser that understands the new rules.
You are attempting to utilize a code that older browser just will not
recognize.
Just because a new rule got implemented doesn't cause the browser to
automatically accept it.
Last week you got a speeding ticket for doing 65 in a 55 zone.
This week the law changed the speed limit to 65.
Are you still guilty? Yep.
Jul 21 '05 #2
Unknown User wrote:
Today I added this rule to my web site:

#container {
min-width: 950px;
width:expression(document.body.clientWidth < 950? "950px": "auto" );
}

And it crashes IE when the width of the window is less than 950px :(
crash confirmed ! :(
How would you correct it?


min-width: 950px;

bad luck, its not supported by Ie

Jul 21 '05 #3
Richard wrote:
On Fri, 04 Mar 2005 14:03:46 -0300 Unknown User wrote:
Today I added this rule to my web site:

#container {
min-width: 950px;
width:expression(document.body.clientWidth < 950? "950px": "auto" );
}

And it crashes IE when the width of the window is less than 950px :(
How would you correct it?

You fix the problem by using a browser that understands the new rules.
You are attempting to utilize a code that older browser just will not
recognize.
Just because a new rule got implemented doesn't cause the browser to
automatically accept it.


You're misunderstanding the situation. The "expression" code the user
posted *only* works in IE, and he's using it as a work-around for the
fact that IE doesn't recognize the min-width property. It's a trick
that's been posted here from time to time.
Jul 21 '05 #4
On Fri, 04 Mar 2005 16:17:34 -0300, Harlan Messinger
<hm*******************@comcast.net> wrote:
You're misunderstanding the situation. The "expression" code the user
posted *only* works in IE, and he's using it as a work-around for the
fact that IE doesn't recognize the min-width property. It's a trick
that's been posted here from time to time.


That's right. What do you suggest beside a PHP browser detection?

--
Boost the visibility of your web site in Google!
http://www.digitalpoint.com/tools/ad-network/?s=5203

Using Opera's revolutionary e-mail client: http://www.opera.com/mail/

http://www.auriance.com - http://www.auriance.net
Jul 21 '05 #5
> min-width: 950px;
width:expression(document.body.clientWidth < 950? "950px": "auto" );
crashes IE when the width of the window is less than 950px :(


Some suggestions:

1. Try IE7 (dean.edwards.name)
2. If IE7 works but it's too slow, work out what is is doing and just
do that. I suspect that it just calls the setExpression method from
javascript and adds an expression very similar, but perhaps subtley
different, to what you have.
3. Put something 950px wide inside the container (e.g. an empty div).
I think this has just about the same effect, doesn't it?
4. Ignore it.

--Phil.

Jul 21 '05 #6
"Unknown User" <me@privacy.net> wrote in message news:<op.sm4hokjer3xrds@cinza>...
Today I added this rule to my web site:

#container {
min-width: 950px;
width:expression(document.body.clientWidth < 950? "950px": "auto" );
}

And it crashes IE when the width of the window is less than 950px :(
How would you correct it?


I ran into this the other day, after finding the technique at
http://www.svendtofte.com/code/max_width_in_ie/ - I found the
expression was only working when the document was missing a doctype,
thereby putting IE in quirks mode. The solution when in standards mode
is to have something like:

width:expression(document.body.clientWidth < 950? "940px": "auto" );

instead of what you have above.

You could also try this Javascript solution:

http://www.doxdesk.com/software/js/minmax.html

This lets you use min/max-height and min/max-width seamlessly, though
does rely on IE users having Javascript enabled for it to work.

Hope that helps,

paul haine
http://joeblade.com/
http://design.joeblade.com/
Jul 21 '05 #7
paul haine wrote:

width:expression(document.body.clientWidth < 950? "940px": "auto" );

You could also try this Javascript solution:


FYI, width:expression also requires JS enabled for it to work

--
Reply email address is a bottomless spam bucket.
Please reply to the group so everyone can share.
Jul 21 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Terry Coccoli | last post by:
We have a Siebel implementation and for one query that was taking a long time to run I asked a DBA to evaluate the explain plan. I noticed that he chose to evaluate the Rule based optimization. I...
6
by: Chris Travers | last post by:
Hi all; I am using PostgreSQL 7.4 on RedHat 9, though I don't think that is important to this problem. I am attempting to write a rule that will check to see whether certain conditions are...
2
by: Joey P | last post by:
Hi all, I am doing a project for university whereby i have to implement a simple database related to a frozen foods company. I am having some trouble though creating a validation rule for one...
3
by: Yahoo | last post by:
GO TO http://sourceforge.net/projects/sdsre/ TO GET THE LATEST VERSION!!! SRE (Simple Rule Engine) is a lightweight forward chaining inference rule engine for .NET. Its 'simple' because of the...
4
by: Chris Kratz | last post by:
Hello all, We have run into what appears to be a problem with rules and subselects in postgres 7.4.1. We have boiled it down to the following test case. If anyone has any thoughts as to why...
1
by: Prabu Subroto | last post by:
Dear my friends... I want to drop a rule but I get an error message. Could you tell me my I can not drop (delete) the rule? Thank you very much in advance. ps: Here is my try underbelow: ...
1
by: Net Virtual Mailing Lists | last post by:
Hello, I have a table with a rule that goes something like this: CREATE OR REPLACE RULE sometable_delete ON DELETE DO delete FROM cache WHERE tablename='sometable'; CREATE OR REPLACE RULE...
8
by: markjerz | last post by:
Hi, I basically have two tables with the same structure. One is an archive of the other (backup). I want to essentially insert the data in to the other. I use: INSERT INTO table ( column,...
1
by: MLH | last post by:
Anyone remember if A97 append query failure would ever report data breaking validation rule when such was not the case. I have an old SQL statement - several years old now. I've encountered a case...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.