1. First in CSS:
#largediagram p { text-align:center }
2. After in Html:
<div id="largediagram"> <p><img src="diagram12.jpg"/></p> <p><img src="diagram13.jpg"/></p> <p><img src="diagram14.jpg"/></p> </div>
3. And you can define the size of img in CSS too:
#largediagram img { width: 350px; height: 200px; }
From: Nelson Ford <[EMAIL PROTECTED]> Reply-To: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Re: [WSG] small css question Date: Tue, 27 Apr 2004 12:49:11 -0700
On 27-Apr-04, at 12:36 PM, Paul Ingraham wrote:
To center an img using css, is it really necessary to do this?
use this:
<img src="diagram12.jpg" width="350" height="200" id="largediagram">
are there going to be many largediagrams? If only one, use id, if many, use class
then:
#largediagram { text-align: center; }
or
#largediagram { display: block; margin: 0 auto; }
text-align works on any inline object directly, so you can apply it directly to the image itself, or just make the image a block-level object and put margins on it. Either way the p tag is superfluous. I hope that helped..
Nelson Ford ------------------------------------------- Geo: Vancouver, BC Net: www.nelsonford.net
***************************************************** The discussion list for http://webstandardsgroup.org/ See http://webstandardsgroup.org/mail/guidelines.cfm for some hints on posting to the list & getting help *****************************************************
_________________________________________________________________
Una nueva forma de navegar. Descarga la Barra de Herramientas de MSN. http://toolbar.msn.es/
*****************************************************
The discussion list for http://webstandardsgroup.org/
See http://webstandardsgroup.org/mail/guidelines.cfm
for some hints on posting to the list & getting help
*****************************************************