You are here: Re: Resize an image to fit a CSS without knowing if it is portrait or landscape shape « HTML « IT news, forums, messages
Re: Resize an image to fit a CSS without knowing if it is portrait or landscape shape

Posted by Jukka K. Korpela on 07/06/07 16:27

Scripsit zorro:

> I have a square shaped CSS

Really? Sounds like a mauve database. But you could have compensated for the
absurdity of the problem description by specifying the URL of your page.
After all, if we can see the page, we can often figure out what the problem
is.

> and I would like to resize a picture to fit it.

Oh.

> The problem is that I do not know if it is a portrait or landscape
> shape picture, so I do not know whether it is the height or the width
> that must be resize to 100% of the CSS.

Probably "square shaped CSS" means an HTML element, probably a div element,
for which you suggest height and width properties with the same value, in
CSS. And now you apparently want to use CSS to scale an image, with
arbitrary intrinsic dimensions, so that it fits into the square occupied by
the element and is as large as possible, within those limits.

The simple answer is that you cannot do that in CSS.

Why do you want to make browsers scale an image in the first place? Old
browsers used to scale very poorly, and hardly any browser scales better
than an average image processing program. So why don't you just do the
scaling server-side?

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

 

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

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