Background image in table


P

PsyberFox

Hi there,

I have added an image to a table in html (using FP2002). When i preview the
page it shows the correct layout (I only want the image once, i.e. no repeat)
but when opening the page in ie it repeats the image across the table. Can
someone please assist me in correcting this.

Here is the table code I used:
<table width=480 cellspacing="0" cellpadding="4" border="0"
style="background-image:url('images/PCS_DragonFly.jpg')"
style="background-position:50% 4%" style="background-repeat:no-repeat">

Thanking you in advance!

W
 
Ad

Advertisements

T

Trevor Lawrence

Works for me.

My image is very small (60*40) and it does not repeat

<html>
<head></head>
<body>
<table width="480" cellspacing="0" cellpadding="4" border="0"
style="background:url('thought bubble.jpg') 50% 4% no-repeat">
<tr><td>
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat
non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</td></tr>
<tr><td>
But I must explain to you how all this mistaken idea of denouncing pleasure
and praising pain was born and I will give you a complete account of the
system, and expound the actual teachings of the great explorer of the truth,
the master-builder of human happiness. No one rejects, dislikes, or avoids
pleasure itself, because it is pleasure, but because those who do not know
how to pursue pleasure rationally encounter consequences that are extremely
painful. Nor again is there anyone who loves or pursues or desires to obtain
pain of itself, because it is pain, but because occasionally circumstances
occur in which toil and pain can procure him some great pleasure. To take a
trivial example, which of us ever undertakes laborious physical exercise,
except to obtain some advantage from it? But who has any right to find fault
with a man who chooses to enjoy a pleasure that has no annoying
consequences, or one who avoids a pain that produces no resultant pleasure?
</td></tr>
</table>

</body>
</html>
 
R

Ronx

You have three style attributes in the table tag - normally only one is
required.
Try this:
<table cellspacing="0" cellpadding="4" style="border: none; width: 480px;
background-image: url('images/PCS_DragonFly.jpg'); background-position: 50%
4%; background-repeat: no-repeat">
--
Ron Symonds
Microsoft MVP (Expression Web)
http://www.rxs-enterprises.org/fp

Reply only to group - emails will be deleted unread.
 
H

Hot-text

You have to make the table as big as the image or the image as big as the
table!
 
Ad

Advertisements

R

Ronx

No you don't.

if the image is larger than the table it will cut off on the right and/or bottom.
If the table is bigger than the image the image will tile to fill the space, UNLESS no-repeat is specified, as in this case.

--
Ron Symonds
Microsoft MVP (Expression Web)
http://www.rxs-enterprises.org/fp/wf-menu.aspx


Hot-text presented the following explanation :
 

Similar threads

S
Replies
3
Views
252
Ronx
R
D
Replies
6
Views
341
Chris Leeds, MVP - FrontPage
C
T
Replies
0
Views
252
Trevor Lawrence
T
H
Replies
3
Views
164
Ronx
R
T
Replies
3
Views
138
Ronx
R
J
Replies
7
Views
118
Murray
M
P
Replies
4
Views
172
Ronx
R
J
Replies
1
Views
141
JacobB
J
Top