Jump to content


Centering an image


3 replies to this topic

#1 Krimson

    Young Padawan

  • Members
  • Pip
  • 1 posts

Posted 29 May 2006 - 06:17 PM

All I want to do is put a line between paragraphs. I have an image I want to use but I cannot get it centered. How can this be done. I would like to know how to do it with css and html ( Im trying to learn this stuff). Ive tried style="text-align: center" and it doesnt work. Thank you in advance.

#2 Jacorre

    P2L Jedi

  • Members
  • PipPipPip
  • 824 posts
  • Gender:Male
  • Location:USA
  • Interests:Computers, Technology, Internet, Graphic/Web Design, Music, Soccer

Posted 29 May 2006 - 06:30 PM

If you want a line, I think you want to use an <hr> tag. If you have have an image you want to use, you could use it as the background-image for the hr and then center it using text-align.

#3 Matthew.

    Official Spammer .Matt

  • Members
  • PipPipPipPip
  • 2,749 posts
  • Gender:Male
  • Location:England

Posted 30 May 2006 - 05:31 AM

Or....

hr {
	margin-left: auto;
	margin-right: auto;
}

Edited by .Matt, 30 May 2006 - 05:31 AM.


#4 rc69

    PHP Master PD

  • P2L Staff
  • PipPipPipPip
  • 3,827 posts
  • Gender:Male
  • Location:Here
  • Interests:Web Development

Posted 30 May 2006 - 12:16 PM

Keep in mind, when using the margin trick, you need to specify a width for it to work.
.center { width:100px; margin: 0 auto; }
And yes, i used shorthand :P

Edited by rc69, 30 May 2006 - 12:16 PM.






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users