You are here: Re: Vertical align of image in a div tag « HTML « IT news, forums, messages
Re: Vertical align of image in a div tag

Posted by dalyea@gmail.com on 11/14/07 09:00

On Nov 13, 11:51 pm, Bone Ur <monstersquas...@yahoo.com> wrote:
> Well bust mah britches and call me cheeky, on Wed, 14 Nov 2007 06:16:56 GMT
> dal...@gmail.com scribed:
>
> > Thanks for the reply. The table option is certainly one I considered
> > and actually
> > have been using for the longest time. But I have 2,000+ such item
> > files that take
> > up 78M of disk space, and I am trying to cut down not only disk space
> > usage
> > but also speed up delivery of my pages. By using the div tags alone
> > instead of
> > tables, I cut my page size total down to 67M for the 2,000+ files.
>
> Huh? Your example showed a table!
>
>
>
> > But that aside, the point of my post was missed in your response, and
> > that is
> > that I wish to display every row in the table at exactly 64px in
> > height, and that
> > the images in the table will not always be 64px or greater in size.
> > (I have written
> > the code obviously to do the simple math scaling to keep image
> > proportional and
> > at or under 64px in size.) If an image is 47px x 30px, then that
> > image will rest
> > at the top of the li1 div container, and I want it to be vertically
> > centered in the middle
> > of the div container (hence the subject line of my post). I guess the
> > part I left out
> > is that the image sizes vary widely and that this is not a 1 row
> > table.
>
> Get the image out of a div and directly in the cell, thenvertical
> centering is easy (and, btw, the default). Whatever other alignment you
> need, work on that afterwards.
>
> --
> Bone Ur
> Cavemen have formidable pheromones.

My example has a surrounding table, but the third cell has two
elements which must
appear side by side - hence the 2 div tags.

col 1 - price
col 2 - web site
col 3 - image + name of product
col 4 - date

So it's col 3 about which I posted. In it, I could use a table, of
course, but I was hoping
to use div tags instead. I want the whole td to be 64px in height,
but I'm controlling that
by setting each div tag to 64px in height. The first div tag li1 will
be the container for
the image, which I want vertically aligned. (And of course, that's
for any arbitrarily sized
image, notably those under 64px in height.) The second div tag li2 is
easy - it's just text.

Thanks for weighing in - hopefully this clarifies the problem at hand.

David

 

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

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