1

Topic: Scaling pics with only CSS ...

I know it works very well on IE ... I haven't tried on Firefox ...


but so ....


<style type="text/css">
.img {
        width : auto;
        text-align : center;
}

.img img {
        width : 99%;
}
</style>

The code in the page / forum ... ?

<div class="img"><img src="pic.jpg" /></div>

Edit : It works well under Firefox 1.0


Test page : http://www.sortons.net/scaling.htm

2

Re: Scaling pics with only CSS ...

Try it with a small image e.g. a smilie.

3

Re: Scaling pics with only CSS ...

Hum ... I didn't thought about that ... I think it's simple to separate an "external" image from smiles (no ?)

Ahhhh but someone can import smilies from another site ...

simple : create a javascript with resolution ?! (no ?)

snif sad

4

Re: Scaling pics with only CSS ...

The simplest way is the way PunBB already does it. Use
IMG {max-width: 100%) for firefox and minmax.js for IE to simulate max-width.

If only IE supported max-width image scaling could be done with just one line of CSS and no javascript. The images would then just scale to fit whatever size container they were in.

5

Re: Scaling pics with only CSS ...

OK I see the problem : I'm looking for my example, and indeed, Firefox doesn't grow  the pic on the whole width of the page, but IE yes ...

So ... Fuck IE ?

6

Re: Scaling pics with only CSS ...

Rod wrote:

So ... Fuck IE ?

http://hcgtv.com/media/tech/clippy.jpg

Re: Scaling pics with only CSS ...

http://www.snopes.com/photos/people/graphics/gates1.jpg

"Programming is like sex: one mistake and you have to support it for the rest of your life."

8

Re: Scaling pics with only CSS ...

Mmmmmm after reflexion, I'd rather fuck a little rabbit than this horrible IE smile

9 (edited by chrizz 2005-02-21 22:37)

Re: Scaling pics with only CSS ...

This is great.

Could anyone suggest a little javascript which will allow you to click the down scaled image and change it to full size? then click again and again have it scaled?

I made this work in FF with a simple javascript, but it wont work in IE.

10 (edited by XuMiX 2005-04-02 02:01)

Re: Scaling pics with only CSS ...

so, a little question:
now all posted images are scaled, how s it possible to view not scaled image ?(i mean without any copy|pasting urls etc.)
is it possible to make an image clickable, and make it full size(in a scroll box, like it was in 1.2) after click?

Re: Scaling pics with only CSS ...

no because it would make even small images clickable

12

Re: Scaling pics with only CSS ...

hm. what about classes ?

Re: Scaling pics with only CSS ...

huh?

Re: Scaling pics with only CSS ...

What's the problem? set 100% width for images and width the padding of the post it's all ok no?
No resize little images.

Sorry for my french english.
GT4 Club driver France & Forum - Lingerie.

Re: Scaling pics with only CSS ...

no i said the small images would also be clickable if you made them all hyperlinks

Re: Scaling pics with only CSS ...

My answer was for the first post.

Why not make a tag like [img h=100px w=200px][/img] and the images larger than 640px will be styled with css width:100%; ?

Sorry for my french english.
GT4 Club driver France & Forum - Lingerie.

Re: Scaling pics with only CSS ...

because who wants to have to enter the height and width every time? also 640 is pretty big you only get 520px when you view this forum at 800x600

Re: Scaling pics with only CSS ...

Put an option in admin panel to force people to use at least width setting in [img] tag and set the width also in panel admin.
(and a have 525px with Mozilla. tongue)

Sorry for my french english.
GT4 Club driver France & Forum - Lingerie.

Re: Scaling pics with only CSS ...

it would be REALLY annoying to have to put a width on img tags and most people would just lie tongue

Re: Scaling pics with only CSS ...

That depend realy of the community. wink

Sorry for my french english.
GT4 Club driver France & Forum - Lingerie.