how do i do that? :P from what i understand of CSS its still somewhat static. if m using IE i will change the size in the CSS by 1 and if m using other browsers that is not IE i will change the size in the CSS by 2 :P can't i do it dynamically? something like if browser = IE then size = 1 else size = 2.

i know the logic but not how to put it into script itself :DEasiest way to implement this here is the !important bug.

!important ought to cause any rules that would override the rule it's applied to to be ignored, unless they are also !important. However, IE ignores it, so we can do things like this:
select {
height: 1.2em !important;
height: 2.4em;
}
DimX: There are two problems with your code. Firstly, you've got the 1 and the 2 completely the wrong way around. :p Secondly, strstr (http://www.php.net/strstr)() can return 0, which will evaluate as false when using type-converting comparison (== and !=) and thus give you an incorrect result. Instead, you must use strict comparison (=== and !==), which will not perform type conversion.

DimX's script solves it exactly with !== or != i dont see the differenceI explained the difference above :)

Twey: ur script ddnt solve exactly my problemIt was an example :)

jr_yeo

07-07-2006, 03:26 PM

even if i use the !== or the !=, the result that im aiming for is still the same :P
this is what i meant by i dont see the difference :D

Twey

07-07-2006, 03:40 PM

Ah, but if "MSIE" appears at the beginning of the UA string, then using !=, that script will detect the browser as not being IE :)

Plus, the user agent string is not necessarily a reliable indicator of the browser. If you looked for "Mozilla," for example, you'd find it in every IE browser's UA string since IE3, I think. Also, some browsers (and firewalls, and a couple of pieces of malware) change or strip the User-Agent header, user intervention aside.