Jump to content


Photo

Background Image To Tr

css html

  • Please log in to reply
3 replies to this topic

#1 zohab

zohab

    Advanced Member

  • Members
  • PipPipPip
  • 223 posts

Posted 19 November 2012 - 02:37 PM

Hi,

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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>background Image</title>
</head>

<body>
<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>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</table>

</body>
</html>


-Thanks
Zohaib.

Attached Files



#2 chwebdesigns

chwebdesigns

    Advanced Member

  • Members
  • PipPipPip
  • 73 posts
  • LocationUK

Posted 19 November 2012 - 04: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,

Cal

#3 play_

play_

    Advanced Member

  • Staff Alumni
  • 717 posts

Posted 21 November 2012 - 06:06 PM

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

http://jsfiddle.net/c3txj/60/

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

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

#4 Love2c0de

Love2c0de

    Advanced Member

  • Members
  • PipPipPip
  • 365 posts
  • LocationThe Pleiades
  • Age:23

Posted 24 November 2012 - 04: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.

Regards,

AoTB.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

Cheap Linux VPS from $5
SSD Storage, 30 day Guarantee
1 TB of BW, 100% Network Uptime

AlphaBit.com