amazing fun cf contest
•
3 Jul 2008, 13:09
•
Journals
as anyone using IE will know, the comments can truly fuck up the layout of crossfire when browsing in IE.
if anyone can figure out a way to fix this in css then you'll get a big SHINY STAR
example page: http://www.crossfire.nu/?x=column&mode=item&id=360
if anyone can figure out a way to fix this in css then you'll get a big SHINY STAR
example page: http://www.crossfire.nu/?x=column&mode=item&id=360
winner will also get a big wet kiss from me =:D
ask the guy who made the crossfire 4.0 journal
compare your changes with the old css
img.resize {width: 50%; height: auto;}
+
<img class="resize" style="max-width: ***px; max-height: ***px;"...>
or smth I'm not pro in this stuff
I think we should just ban IE users from cf :X
But opera and FF are automatically resizing images has nothing to with css right? Or am I talking shit now?
"This page is optimized for Firefox etc"
IE users need to die anyway :>
what's more important (maybe it's already there) i want a flash game when you are banned :( or atleast that bumping fish gif from tosspot his profile
and no dunnow how to fix it :(
IE has the ability to perform javascript like (or is it javascript? I dunno) functions on it's CSS so you can fake max-width with it. Here's the syntax.
selector {width: expression(this.width > value ? value: true);}
I'm not gonna pretend I know everything going on there, suffice to say this is how you might use it with the max-width property example we used before.
.post-body img {
max-width:400px;
width: expression(this.width > 400 ? 400: true);
}
The two values in the IE statement would be the same value as your max-width statement in pixels. Unfortunately, as far as I've been able to find out you can't use this method with percentages in IE(least I haven't found a way to ). Browsers other than IE will safely ignore the width:expression statement and just implement the max-width.
I probably should mention that max-width isn't just for images, it can be applied to any element that you would apply a width to. I should also note that if you try the IE fake to keep it from enlarging a container, you have to apply it to the problem element, not the container itself. You can apply the IE fake to a container (to keep it from going naturally over a certain width ) BUT if an element inside that container (an image, table, whatever) is larger than that width it will still enlarge it's container in IE. In those cases apply max-width and the fake to the element causing the issue, not the container itself. Did I just confuse the matter?
So for an example, if images in the #sidebar div were causing an issue doing this
#sidebar {width:220px;
width: expression(this.width > 220 ? 220: true);
}
would NOT HELP IE. Here it's only applied to the containing div#sidebar. The offending images would still enlarge it.
Attack the element directly like
#sidebar img {max-width:200px;
width: expression(this.width > 200 ? 200: true);
}
A statement like that would keep the images in the #sidebar (if that's the id of your sidebar, it could be different) in check.
Then again you could resize those damn images... ;-)
source : http://phydeaux3.blogspot.com/2006/01/max-width-and-faking-it-for-ie.html