Jump to content


Background Image To Tr

css html

  • Please log in to reply
3 replies to this topic

#1 zohab

  • Members
  • PipPipPip
  • Advanced Member
  • 223 posts

Posted 19 November 2012 - 07:37 PM


I have added background image blueGradient.png to tr.

It is not showing as expected.

attached image.

I want to show background image properly and need help in this.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>background Image</title>

<table width="100%" border="1">
<tr style=" background-color:#00FFFF; background-image:url(blueGradient.png); background-repeat:repeat;">
<td colspan="2" align="center">Title</td>



Attached Files

#2 chwebdesigns

  • Members
  • PipPipPip
  • Advanced Member
  • 73 posts
  • LocationUK

Posted 19 November 2012 - 09:32 PM

This is just a guess at what you mean by properly!

But how about:

background-color: white; background-image:url(blueGradient.png); background-repeat:repeat-x; background-position: bottom left;

Also just a suggestion, it is normally better to define a style in a .css file as a class (e.g. tr .background ) and then have the code <tr class="background">

Hope this helps a bit,


#3 play_

  • Staff Alumni
  • Advanced Member
  • 717 posts

Posted 21 November 2012 - 11:06 PM

What does 'not showing as expected' mean? How are you expecting it to show?


Edited by play_, 21 November 2012 - 11:07 PM.

regex.kat.sh --- regex library
u.kat.sh ---- url shortener
tabbit.org ---- tabbed pastebin

#4 Love2c0de

  • Members
  • PipPipPip
  • Advanced Member
  • 366 posts
  • LocationThe Pleiades
  • Age:23

Posted 24 November 2012 - 09:02 PM

The image is in the same directory as your html file isn't it? Or is it in a different folder called 'images' for example?

Just copied your code and used my own image and it is displaying the image.

It's a little hard to debug what the problem is without a specific problem.



0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users