...

View Full Version : Centre-Align elements



GBizzle99
05-04-2009, 05:54 PM
How do you make an element centre align. For example I have an image within a column and want it to centre within that column?

cheers

effpeetee
05-04-2009, 07:26 PM
Is this any use to you here (http://www.wpdfd.com/editorial/thebox/deadcentre4.html).

Some extra help here (http://exitfegs.co.uk/Sources.html)

Frank

Excavator
05-05-2009, 12:59 AM
I have an image within a column and want it to centre within that column?

cheers

To center anything you need 3 things:

a DocType declaration
an element with a width
that elements left and right margins set to auto


Since you kjnow the width of your image, give it an id... <img src="myDir/myPic.jpg alt="description" id="pic1" />
and then style that id in your CSS.
Like this -

#pic1 {
width: XXpx;
margin: 0 auto;
}

cf.canton
05-05-2009, 03:46 AM
Is this any use to you here (http://www.wpdfd.com/editorial/thebox/deadcentre4.html).

Some extra help here (http://exitfegs.co.uk/Sources.html)

Frankhttp://www.tracker-analytics.com/track/img/3765/s09v0317fvxp/00.gif

The first link is quite handy, thanks a lot. Lots of great information out there, just a matter of finding it.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum