HighDots Forums  

Re: centering images

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


Discuss Re: centering images in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Gérard Talbot
 
Posts: n/a

Default Re: centering images - 12-21-2006 , 10:53 PM






Troy Piggins wrote :
Quote:
How do you center images within a <div> - or any other element
for that matter?

Interactive demo on CSS horizontal alignment and horizontal formating
CSS Horizontal alignment:
when to use margin-left, margin-right and when to use text-align
http://www.gtalbot.org/NvuSection/Nv...Alignment.html

If I try
Quote:
margin-left: 50%;

Margin use will align accordingly a block-level element within its
containing parent; it will not align its inline element children. You
need to use text-align for this.


Quote:
it's only the left hand side of the image that is on the
centerline, not the center of the image.

margin-left: 50%;
margin-right: 50%;

I thought this may do it, but still same problem.

"The [text-align] property describes how text (and inline elements) is
aligned within the element."
CSS 1 text-align property
http://www.w3.org/TR/CSS1#text-align

Gérard
--
remove blah to email me


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.