How do I centre a background image in a table?

  • Sophiechen
  • Born
  • Born
  • Sophiechen
  • Posts: 1

Post 3+ Months Ago


I am desperately trying to centre an image within a table but dont seem to be able to make it work. I went to the page source and changed the align=left bit to align=centra but that doesnt seem to help :-( Here is the code bit:

<TD style="BACKGROUND: url(/DSC01043_edited.JPG-for-web-NORMAL.jpg) no-repeat" vAlign=center align=center>
<P><FONT color=#000000></FONT>&nbsp;</P></TD></TR></TBODY></TABLE>
<TABLE style="BORDER-COLLAPSE: collapse" cellSpacing=0 cellPadding=0 width=800>

The bold bit is the one I changed. Could anyone tell me why it is not working and what I need to do to get my image in the middle?
I am grateful for all help as I dont really know much about CSS!

Thank you!
  • Breeze
  • Photographer
  • Guru
  • User avatar
  • Posts: 1029
  • Loc: Australia

Post 3+ Months Ago

Code: [ Select ]
<td style="background-image: url(/DSC01043_edited.JPG-for-web-NORMAL.jpg); background-position: center;">

That should do it ... also, what's with the name of the image - kinda weird.
  • righteous_trespasser
  • Scuffle
  • Genius
  • User avatar
  • Posts: 6228
  • Loc: South-Africa

Post 3+ Months Ago

maybe just add the no-repeat and the single quotes ...
Code: [ Select ]
<td style="background-image: url('/DSC01043_edited.JPG-for-web-NORMAL.jpg'); background-position: center;background-repeat:no-repeat">

Post Information

  • Total Posts in this topic: 3 posts
  • Users browsing this forum: No registered users and 22 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum

© 1998-2017. Ozzu® is a registered trademark of Unmelted, LLC.