You are here: Re: want max width and max height as long as not exceed 100px « HTML « IT news, forums, messages
Re: want max width and max height as long as not exceed 100px

Posted by dorayme on 10/23/07 02:16

In article
<1193103732.518769.142630@z24g2000prh.googlegroups.com>,
Summercool <Summercoolness@gmail.com> wrote:

> On Oct 22, 6:10 pm, dorayme <doraymeRidT...@optusnet.com.au> wrote:
>
> > img {max-width: 100px;}
> >
> > or
> >
> > img {max-height: 100px;}
>
> >
> > <img class="landscape" src="pic.jpg" ...> and in your css, put
> > only a width, say 100px. It will find its natural height.
> >
> > <img class="portrait" src="pic.jpg" ...> and in your css, put
> > only a height, say 100px. It will find its natural width.
>
> I think max-width and max-height both work in Firefox and Safari (the
> latest), but not on IE 7.0....
>

max-width works with IE7 in general. I cannot vouch for it
working with images. It was with IE6 and less that max-width was
not supported.


> that's a great solution, landscape and portrait....
> is it true you still have to use javascript to tell whether it is
> landscape or portrait if the picture is unknown beforehand from the
> database?
>

No, you can do it with PHP. You might go to the php.alt nesgroup
for help with this.


> at least I can pass a parameter to the next .php file saying whether
> it is landscape or portrait and that can be cleaner than passing the
> width x height.

Sure. I am a bit of a fan of sorting these profiles into two and
organising thumbnails in two blocks without mixing them. I know,
it is more of a bore and involves actual work! <g>

I recommend not to use tables at all for where there are a lot of
thumbnails. You may care to look at a template like:

http://members.optushome.com.au/droovies/thumbnails/thumbLandscape
Gallery7.html

(the js is an enhancement to centre the whole show, so don't be
distracted by it; without it, the pages work essentially the same)

Here is a similar (but slightly different implementation without
tables):

http://tvrs.org.au/gallery/gallery.html

The thing about floating or inline images is the way it very
usefully uses the space, automatically wrapping. It is done a lot
on the modern web and you simply cannot get this sort of
flexibility with tables.

--
dorayme

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация