pouët.net

images inserted with [img] size

category: general [glöplog]
The conditionnal comment is there to make sure this IE proprietary thing is only parsed by IE < 8. That should be pretty safe.

Quote:
plus it needs to handle % not pixels.
That's what the this.parentNode.clientWidth*.95 does. AFAIR CSS expressions are reevaluated whenever something changes on the page, including a resize.

It's a tad late now, but I could try to fiddle with that tomorow.
added on the 2008-10-07 02:32:24 by p01 p01
no offense, ps, but jesus fucking christ
added on the 2008-10-07 03:03:47 by reed reed
yes, its an ugly hack. it works so i dont care.
added on the 2008-10-07 03:44:34 by psenough psenough
Quote:
also i would have to install all ie versions to test and i dont want to install malware on my machine ;)


http://browsershots.org/
Quote:
yes, its an ugly hack. it works so i dont care.


umm right... so "all images are fucked up on all browsers except one" is a working fix nowadays?
added on the 2008-10-07 09:17:34 by uncle-x uncle-x
ps:
Quote:
the rest of the css should supposedly work properly on its own with just max-width: 95%; width: 100%; but it doesnt, because the browsers dont follow the standard: if you set max-width the browsers stretch the pic to match the border instead of limiting the pics that are higher width than the container width
Nei. As I said earlier, img { max-width: 95%; width: 100%; } forces images to be 95% as wide as their container. It does so because you set their width to 100% of their container, but the width is clamped to 95% through the max-width property.

If you want images to be displayed in their intrinsinc size, but be downscaled if wider than 95% of their container, the ONLY rule you need in a standard compliant browser is:
Code:img {max-width:95%; }
Then comes IE, for which you have to use proprietary hacks and branches like the conditional comment + CSS expression I gave earlier.



The current solution only works in FF because of the -moz-max-content thing. But it breaks -- images are forced to 95% -- everywhere else for the reason I mentioned above.

A really cheap solution to the IE and max-width problem could be:
Code:.bbimage { overflow:auto; /* add scrollbars to the container if needed */ } .bbimage img { max-width:95%; }
Done.



added on the 2008-10-07 09:20:15 by p01 p01
all these web technologies are a mistery to me, but I anyway find amazing that still in 2008 there are problems to display an image on screen. It's really scary.
added on the 2008-10-07 09:32:50 by iq iq
Code:<!doctype html> <!-- it's HTML5 baby, and triggers STRICT mode in IE6 --> <html> <head> <title>test case : max-width on IMG </title> <style> img { max-width:100%; } .bbimage { overflow:auto; background:silver; } </style> </head> <body> <p>resize your browser window to see the <em>max-width</em> in action.</p> <h1>The standard way</h1> <div><img src="http://www.pouet.net/gfx/logos/pouetlawgo.png" ></div> <h1>And now the &quot;really cheap solution&quot;</h1> <div class="bbimage"><img src="http://www.pouet.net/gfx/logos/pouetlawgo.png" ></div> </body> </html>



iq: Blame MicroSoft for not respecting the CSS2 specification which was published the 12-May-1998.
added on the 2008-10-07 09:44:53 by p01 p01
unclex: does cannapaceus work on ATI yet?

i'll try some cleaner fix later today with this crap.
added on the 2008-10-07 14:27:25 by psenough psenough
ps: On most newer ones, yes. Anyways it works on more configurations than one :-)
added on the 2008-10-07 14:42:26 by uncle-x uncle-x
http://browsershots.org/ is good for testing, btw...
added on the 2008-10-07 15:17:14 by kb_ kb_
did anyone notice that the div will cause images that were supposed to be next to each other to be block-level (= under each other)? :)
added on the 2008-10-07 15:22:36 by Gargaj Gargaj
Gargaj: yep. Not sure what the purpose of that DIV is. But it prevents people to do a collage of avatars or inline a small images in a sentence.
added on the 2008-10-07 15:50:24 by p01 p01
I have to agree with those complaining, it's a bitch with those zoomed up images. The old way with the odd huge image was way better than this zoom-craze.
added on the 2008-10-07 18:36:15 by evil evil
Stop complaining and just use Firefox. Everyone in the world uses it.
(no, i'm not)
btw, it's also zoomed up in opera. And i can't install FF3 at school.
Neither am I, I'm using Safari due to it's major speed advantage over firefox3. And I find PithHelmet to be a nicer adblocker than Adblock+.
added on the 2008-10-07 21:03:10 by evil evil
People using a standard compliant browser ( read IE8, Opera, Safari, Chrome ) that is not FireFox 3 can use the user stylesheet I mentionned in my first post to fix the Pouet's " fix " using a -moz-thing for IE6 and IE7 that make BB images look stupid in ALL browsers but FF3
added on the 2008-10-07 21:23:59 by p01 p01
since when IE8 is 'standard compliant' ? they recently passed the acid2 test and bragged about it. acid2 is 3 years old now.

As for acid3:
BB Image
BB Image
added on the 2008-10-07 21:38:18 by LiraNuna LiraNuna
acid2/3 isn't really a good measure for "standard compliance" in this context
added on the 2008-10-07 21:43:54 by stijn stijn
what iq said.
added on the 2008-10-07 22:42:53 by faraday faraday
it's still borked in chrome btw
and in FF2
added on the 2008-10-12 15:06:52 by Frost Frost
ok so apparently it's still borked everywhere ?
come on ...

login