|
|
|
#1 |
|
Messages: n/a
Hébergeur: |
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é |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
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 |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
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é |
|
|
|
#4 |
|
Messages: n/a
Hébergeur: |
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é |
|
|
|
#5 |
|
Messages: n/a
Hébergeur: |
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 |
|
|
|
#6 |
|
Messages: n/a
Hébergeur: |
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> |
|
|
|
#7 |
|
Messages: n/a
Hébergeur: |
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. |
|
|
|
#8 |
|
Messages: n/a
Hébergeur: |
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". |
|
![]() |
| Outils de la discussion | |
|
|