PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > comp.info.authoring.CSS > Centering again
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Centering again

Réponse
 
LinkBack Outils de la discussion
Vieux 25/03/2008, 01h10   #1
André Hänsel
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Centering again

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>

Regards,
André
  Réponse avec citation
Vieux 27/03/2008, 01h19   #2
Gary
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Centering again

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>
>
> Regards,
> André


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

I am new at CSS but what I have done is

<div style="margin: 0 auto; width: 10em;">
<img src="/img/image.gif" alt="image">
</div>

with the width being the width of the image. I don't remember why I
didn't
roll the style into the img tag and do away with the div, I'll try
that next time.

Gary
  Réponse avec citation
Vieux 28/03/2008, 01h01   #3
André Hänsel
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Centering again

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>

>
> > Regards,
> > André

>
> 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.

Regards,
André
  Réponse avec citation
Vieux 30/03/2008, 03h39   #4
jACK
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Centering again

Andre

If the below link was supposed to show the image centered both ways,
sorry, it didn't work in either IE7 or Firefox. ????


On Thu, 27 Mar 2008 17:01:49 -0700 (PDT), André Hänsel
<andre@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>

>>
>> > Regards,
>> > André

>>
>> 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.
>
>Regards,
>André

  Réponse avec citation
Vieux 30/03/2008, 05h29   #5
Gus Richter
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Centering again

jACK wrote:
> Andre
>
> If the below link was supposed to show the image centered both ways,
> sorry, it didn't work in either IE7 or Firefox. ????


While you're at it, ask the OP why he is unable to size all his images
to the same dimensions and why the unmentioned image cycling?

--
Gus
  Réponse avec citation
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
Vieux 01/04/2008, 19h42   #7
André Hänsel
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Centering again

On Mar 30, 2:13 pm, "Roy A." <royarnes...@gmail.com> wrote:
> 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:

>
> > 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.

>
> Maybe you could use a background image:


That's a good idea for centering the image. Unfortunately the link
doesn't work yet.
  Réponse avec citation
Vieux 01/04/2008, 19h44   #8
André Hänsel
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Centering again

On Mar 30, 6:29 am, Gus Richter <gusrich...@netscape.net> wrote:
> jACK wrote:
> > If the below link was supposed to show the image centered both ways,
> > sorry, it didn't work in either IE7 or Firefox. ????

>
> While you're at it, ask the OP why he is unable to size all his images
> to the same dimensions and why the unmentioned image cycling?


You don't talk to me?

I didn't mention the image cycling because it is irrelevant for the
problem. It's just there to avoid inappropriate answers like "set the
width of blabla to 123px then it is centered".
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 21h05.


Édité par : vBulletin® version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,14733 seconds with 16 queries