I am making a website and I had a quick question... It is probably considered a 'rookie question', I have a feeling it is something really easy. I want to center an object without using <center> tags, but when I do that, it centers it based off of the top left corner like usual. How can I change the positioning to the center of the image as opposed to the top left corner?
Positioning of Images on a Website Question
Page 1 of 16 Replies - 425 Views - Last Post: 07 February 2013 - 03:16 PM
Replies To: Positioning of Images on a Website Question
#2
Re: Positioning of Images on a Website Question
Posted 06 February 2013 - 08:21 PM
instead of using the <center> tag directly, you can change the position of the image in your CSS
regards,
Raghav
regards,
Raghav
#3
Re: Positioning of Images on a Website Question
Posted 07 February 2013 - 12:35 AM
mgaines2, on 07 February 2013 - 03:56 AM, said:
I want to center an object without using <center> tags, but when I do that, it centers it based off of the top left corner like usual.
then what do you use that you get this result. usually it is centred based on the objects centre, but we may be talking of different "usually"s here.
#4
Re: Positioning of Images on a Website Question
Posted 07 February 2013 - 10:59 AM
mgaines2, on 06 February 2013 - 07:56 PM, said:
I am making a website and I had a quick question... It is probably considered a 'rookie question', I have a feeling it is something really easy. I want to center an object without using <center> tags, but when I do that, it centers it based off of the top left corner like usual. How can I change the positioning to the center of the image as opposed to the top left corner?
Set the margins (at least left and right at the minimum) to auto. Should do it.
#5
Re: Positioning of Images on a Website Question
Posted 07 February 2013 - 12:30 PM
#6
Re: Positioning of Images on a Website Question
Posted 07 February 2013 - 03:13 PM
I did try setting the margins to auto, but it doesnt work still.
#7
Re: Positioning of Images on a Website Question
Posted 07 February 2013 - 03:16 PM
of course it doesn’t work. the margin-auto trick requires a block element to work.
just setting the text-align of the parent element to center should do it.
just setting the text-align of the parent element to center should do it.
Page 1 of 1
|
|

New Topic/Question
Reply


MultiQuote



|