Web Design Web Design Forum
Registration is free! Here you can view your subscribed threads, work with private messages and edit your profile and preferences Calendar Find other members Frequently Asked Questions Search
Home Web Design

Convenient web based access to our favorite web design Usenet groups

web design reviews

This is Interesting: Free Magazines for Graphics designers and webmasters  





  Last Thread  Next Thread
Author
Thread Post New Thread   

Centering images
 

Abs




quote this post edit post

IP Loged report this post

Old Post  06-27-04 - 12:15 AM  
Hi!

I'm having a little problem with my site. I know how to center DIVs
using the "margin: auto" thing. But I'm unable to center two images.
I used the "text-align: center" hack with no results, too.

Here is my site:

http://project.fotografist.com/


and the CSS:

http://project.fotografist.com/styles/styles_black.css


Basically, I need to center the images in the "photos" DIV.


Can someone help me, please ?


thanks in advance


Post Follow-Up to this message ]
Re: Centering images
 

Els




quote this post edit post

IP Loged report this post

Old Post  06-27-04 - 12:15 AM  
Abs wrote:

> Hi!
>
>    I'm having a little problem with my site. I know how to
>    center DIVs
> using the "margin: auto" thing. But I'm unable to center
> two images. I used the "text-align: center" hack with no
> results, too.
>
> Here is my site:
>
> http://project.fotografist.com/
>
>
> and the CSS:
>
> http://project.fotografist.com/styles/styles_black.css
>
>
> Basically, I need to center the images in the "photos" DIV.
>
>
> Can someone help me, please ?

I'm not sure what it is you want: center them one below the
other? or next to each other?

You are using float:left on the div which surrounds the first
img, this will never get it centered. Float:left means left,
not centered.
Also you don't need to put divs around the img's, you can
apply the styles to the img elements themselves.

--
Els
http://locusmeus.com/
Sonhos vem. Sonhos vão. O resto é imperfeito.
- Renato Russo -


Post Follow-Up to this message ]
Re: Centering images
 

Abs




quote this post edit post

IP Loged report this post

Old Post  06-27-04 - 12:15 AM  
Els wrote:

>
> I'm not sure what it is you want: center them one below the
> other? or next to each other?

yes, one next to the other.

> You are using float:left on the div which surrounds the first
> img, this will never get it centered. Float:left means left,
> not centered.
> Also you don't need to put divs around the img's, you can
> apply the styles to the img elements themselves.
>

Ok, I'll try with no DIVs surrounding the images.


Post Follow-Up to this message ]
Re: Centering images
 

Abs




quote this post edit post

IP Loged report this post

Old Post  06-27-04 - 12:15 AM  
Abs wrote:

> Els wrote:
> 
>
>
> yes, one next to the other.
> 
>
> Ok, I'll try with no DIVs surrounding the images.

Great, it works now. But I don't know if the text-align hack is the
right way to do it. Anyways...


Post Follow-Up to this message ]
Re: Centering images
 

Els




quote this post edit post

IP Loged report this post

Old Post  06-27-04 - 12:15 AM  
Abs wrote:

> Abs wrote:
> 
>
> Great, it works now. But I don't know if the text-align
> hack is the right way to do it. Anyways...

You must notice though, that in IE, if the window is narrower
than the width of the two pictures, it won't be centered
anymore. In Gecko browsers, it will remain centered, thus
'losing' the left side of the left picture, where no scrollbar
will go. In IE, the left border of the left picture will stop
when touching the left side of the window, while the column
will remain centered.

--
Els
http://locusmeus.com/
Sonhos vem. Sonhos vão. O resto é imperfeito.
- Renato Russo -


Post Follow-Up to this message ]
Re: Centering images
 

Brian




quote this post edit post

IP Loged report this post

Old Post  06-28-04 - 12:16 AM  
Abs wrote:
 
>
> I don't know if the text-align hack is the right way to do it.

IMG is inline by default, and text-align is for inline content, so it
is the right way to do it, and is not a "hack".

--
Brian (remove ".invalid" to email me)
http://www.tsmchughs.com/


Post Follow-Up to this message ]
Sponsored Links
 





All times are GMT. The time now is 04:31 AM. Post New Thread   
  Previous Last Thread   Next Thread next
Stylesheets archive | Show Printable Version | Email this Page | Subscribe to this Thread

Popular forums

Adobe Photoshop forum Macromedia Flash Web Site Design
Dreamweaver FrontPage forum
JavaScript Forum XML forum
Style Sheets VRML
Forum Jump:
Rate This Thread:

 

XML RSS Feed web design latest articles Syndicate our forum via XML or simple JavaScript

Web Design archive  Database administration help  


Top Home  -  Register  -  Control Panel   -  Memberlist  -  Calendar  -  Faq  -  Search Top