6 Replies - 528 Views - Last Post: 07 February 2013 - 03:16 PM

#1 mgaines2  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 74
  • Joined: 06-December 12

Positioning of Images on a Website Question

Posted 06 February 2013 - 07:56 PM

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?
Is This A Good Question/Topic? 0
  • +

Replies To: Positioning of Images on a Website Question

#2 raghav.naganathan  Icon User is offline

  • Perfectly Squared ;)
  • member icon

Reputation: 408
  • View blog
  • Posts: 1,440
  • Joined: 14-September 12

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
Was This Post Helpful? 0
  • +
  • -

#3 Dormilich  Icon User is online

  • 痛覚残留
  • member icon

Reputation: 3521
  • View blog
  • Posts: 10,161
  • Joined: 08-June 10

Re: Positioning of Images on a Website Question

Posted 07 February 2013 - 12:35 AM

View Postmgaines2, 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.
Was This Post Helpful? 0
  • +
  • -

#4 codespook  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 146
  • Joined: 31-October 12

Re: Positioning of Images on a Website Question

Posted 07 February 2013 - 10:59 AM

View Postmgaines2, 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.
Was This Post Helpful? 0
  • +
  • -

#5 Dormilich  Icon User is online

  • 痛覚残留
  • member icon

Reputation: 3521
  • View blog
  • Posts: 10,161
  • Joined: 08-June 10

Re: Positioning of Images on a Website Question

Posted 07 February 2013 - 12:30 PM

View Postcodespook, on 07 February 2013 - 06:59 PM, said:

Should do it.

not on inline elements.
Was This Post Helpful? 0
  • +
  • -

#6 mgaines2  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 74
  • Joined: 06-December 12

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.
Was This Post Helpful? 0
  • +
  • -

#7 Dormilich  Icon User is online

  • 痛覚残留
  • member icon

Reputation: 3521
  • View blog
  • Posts: 10,161
  • Joined: 08-June 10

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.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1