HighDots Forums  

Centering again

Cascading Style Sheets Layout/presentation on the WWW (comp.infosystems.www.authoring.stylesheets)


Discuss Centering again in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
André Hänsel
 
Posts: n/a

Default Centering again - 03-24-2008 , 07:10 PM






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é

Reply With Quote
  #2  
Old   
Gary
 
Posts: n/a

Default Re: Centering again - 03-26-2008 , 07:19 PM






On Mar 24, 5:10 pm, André Hänsel <an... (AT) webkr (DOT) de> wrote:
Quote:
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


Reply With Quote
  #3  
Old   
André Hänsel
 
Posts: n/a

Default Re: Centering again - 03-27-2008 , 07:01 PM



On Mar 27, 1:19 am, Gary <gs... (AT) yahoo (DOT) com> wrote:
Quote:
On Mar 24, 5:10 pm, André Hänsel <an... (AT) webkr (DOT) 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é


Reply With Quote
  #4  
Old   
jACK
 
Posts: n/a

Default Re: Centering again - 03-29-2008 , 09:39 PM



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 (AT) webkr (DOT) de> wrote:

Quote:
On Mar 27, 1:19 am, Gary <gs... (AT) yahoo (DOT) com> wrote:
On Mar 24, 5:10 pm, André Hänsel <an... (AT) webkr (DOT) 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é

Reply With Quote
  #5  
Old   
Gus Richter
 
Posts: n/a

Default Re: Centering again - 03-29-2008 , 11:29 PM



jACK wrote:
Quote:
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


Reply With Quote
  #6  
Old   
Roy A.
 
Posts: n/a

Default Re: Centering again - 03-30-2008 , 07:13 AM



On 28 Mar, 02:01, André Hänsel <an... (AT) webkr (DOT) de> wrote:
Quote:
On Mar 27, 1:19 am, Gary <gs... (AT) yahoo (DOT) com> wrote:



On Mar 24, 5:10 pm, André Hänsel <an... (AT) webkr (DOT) 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>


Reply With Quote
  #7  
Old   
André Hänsel
 
Posts: n/a

Default Re: Centering again - 04-01-2008 , 01:42 PM



On Mar 30, 2:13 pm, "Roy A." <royarnes... (AT) gmail (DOT) com> wrote:
Quote:
On 28 Mar, 02:01, André Hänsel <an... (AT) webkr (DOT) de> wrote:

On Mar 27, 1:19 am, Gary <gs... (AT) yahoo (DOT) com> wrote:

On Mar 24, 5:10 pm, André Hänsel <an... (AT) webkr (DOT) 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.


Reply With Quote
  #8  
Old   
André Hänsel
 
Posts: n/a

Default Re: Centering again - 04-01-2008 , 01:44 PM



On Mar 30, 6:29 am, Gus Richter <gusrich... (AT) netscape (DOT) net> wrote:
Quote:
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".


Reply With Quote
  #9  
Old   
Gus Richter
 
Posts: n/a

Default Re: Centering again - 04-01-2008 , 05:02 PM



André Hänsel wrote:
Quote:
On Mar 30, 6:29 am, Gus Richter <gusrich... (AT) netscape (DOT) 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?
Because I might revert to the vernacular.

Quote:
I didn't mention the image cycling because it is irrelevant for the
problem.
Was not so irrevelent for me. I took the time to set up something and
when testing it I noticed the different size images cycled. I dropped
any attempt to assist further.

Quote:
It's just there to avoid inappropriate answers like "set the
width of blabla to 123px then it is centered".
Why couldn't you mention it beforehand with ALL pertinent information?
I'm out of this thread.

--
Gus


Reply With Quote
  #10  
Old   
André Hänsel
 
Posts: n/a

Default Re: Centering again - 04-04-2008 , 10:27 AM



On Apr 2, 12:02 am, Gus Richter <gusrich... (AT) netscape (DOT) net> wrote:
Quote:
André Hänsel wrote:
On Mar 30, 6:29 am, Gus Richter <gusrich... (AT) netscape (DOT) 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?

Because I might revert to the vernacular.

I didn't mention the image cycling because it is irrelevant for the
problem.

Was not so irrevelent for me. I took the time to set up something and
when testing it I noticed the different size images cycled. I dropped
any attempt to assist further.

It's just there to avoid inappropriate answers like "set the
width of blabla to 123px then it is centered".

Why couldn't you mention it beforehand with ALL pertinent information?
I'm out of this thread.
Sorry for knocking over your effort. I thought, I implicitly said that
I don't know the width of the image by not saying that I knew it. Also
it's quite obvious that centering an image with KNOWN dimensions is no
problem AT ALL.


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.