Discussion: Centering again
Afficher un message
Vieux 30/03/2008, 13h13   #6
Roy A.
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Centering again

On 28 Mar, 02:01, André Hänsel <an...@webkr.de> wrote:
> On Mar 27, 1:19 am, Gary <gs...@yahoo.com> wrote:
>
>
>
> > On Mar 24, 5:10 pm, André Hänsel <an...@webkr.de> wrote:

>
> > > Hi,

>
> > > I have <div><a><img /></a></div>. The dimensions of the div are fixed.

>
> > > I want the image centered and at the bottom.

>
> > > Isn't there another way than this ugly thing?
> > > <div><table height="100%" width="100%" cellspacing="0" cellpadding="0"
> > > border="0" valign="bottom" align="center"><tr><td><a><img /></a></td></
> > > tr></table></div>


> > The big thing in this group is give a URL not code.

>
> No problem. http://kundenweb.creations.de/usenet/css/center.htm
>
> I want the image centered horizontally and vertically in the box. It
> should work in IE6, too.


You could use "display: table-cell; vertical-align: middle"

To make it work in legacy browsers you have to use a table with one td
element.

Maybe you could use a background image:

.box {
width: 400px; height: 300px; display: block;
background: fuchsia url('catcycle.jpg') no-repeat 50% 50%
}

<div>
<a blass="box" href="javascript: alert('Meow!');"></a>
</div>

You should use at proper doctype:
<http://www.w3.org/QA/2002/04/valid-dtd-list.html>
  Réponse avec citation
 
Page generated in 0,05572 seconds with 9 queries